Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sessions): store session's meatadata #13990

Merged
merged 1 commit into from
Dec 31, 2024
Merged

feat(sessions): store session's meatadata #13990

merged 1 commit into from
Dec 31, 2024

Conversation

raoxiaoyan
Copy link
Contributor

@raoxiaoyan raoxiaoyan commented Dec 9, 2024

Summary

Engineering brief:
https://docs.google.com/document/d/1r7nSZGOlTVhupoVGQ6Ymqsaw64eGHKSMibko8FgrwAQ/edit?tab=t.0
### This PR won't bring a break change.
Add two new configurationshash_subject(by default false) and store_metadata(by default false). Please ref here.
Add a new table session_metadatas to store the session's metadata.

CREATE TABLE IF NOT EXISTS session_metadatas(
        id            uuid,
        session_id    uuid                    REFERENCES "sessions" ("id") ON DELETE CASCADE,
        sid           text,
        subject       text,
        audience      text,
        created_at    timestamp WITH TIME ZONE,
        PRIMARY KEY (id)
      );

Why to do this?
Please check this PR's ticket.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

KM-788

@raoxiaoyan raoxiaoyan marked this pull request as draft December 9, 2024 02:30
@github-actions github-actions bot added plugins/session schema-change-noteworthy cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Dec 9, 2024
@raoxiaoyan raoxiaoyan force-pushed the feat/KM-788 branch 3 times, most recently from 30ce6e0 to 7158135 Compare December 16, 2024 07:30
@raoxiaoyan raoxiaoyan marked this pull request as ready for review December 18, 2024 23:36
@raoxiaoyan
Copy link
Contributor Author

@bungle Could you take a review for this PR, please?

@sumimakito
Copy link
Member

The changes in the pull request expose the controls on the hash_subject and store_metadata parameters from lua-resty-session, which look good to me.

@raoxiaoyan raoxiaoyan force-pushed the feat/KM-788 branch 2 times, most recently from 90fd87a to d94436f Compare December 26, 2024 01:59
@raoxiaoyan raoxiaoyan force-pushed the feat/KM-788 branch 2 times, most recently from 72c0fc6 to 66572c8 Compare December 27, 2024 03:07
@outsinre
Copy link
Contributor

If the session data is stored in the cookie, should we care about the session metadata?

@ADD-SP ADD-SP merged commit 938747a into master Dec 31, 2024
30 checks passed
@ADD-SP ADD-SP deleted the feat/KM-788 branch December 31, 2024 03:14
@team-gateway-bot
Copy link
Collaborator

Successfully created cherry-pick PR for master:

ADD-SP pushed a commit that referenced this pull request Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee plugins/session schema-change-noteworthy size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants