Make client_cookie a persistent and editable client attribute#563
Make client_cookie a persistent and editable client attribute#563
client_cookie a persistent and editable client attribute#563Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds a persistent, validated Changes
Sequence Diagram(s)sequenceDiagram
participant ClientAPI as Client API
participant ClientService as ClientService
participant CookieService as CookieService
participant DB as Database
ClientAPI->>ClientService: register/update client (payload may include cookie_name)
alt payload includes cookie_name
ClientService->>DB: persist client with provided cookie_name
else no cookie_name provided
ClientService->>DB: read client record
alt client.cookie_name already set
ClientService-->>DB: skip cookie-name assignment
else not set
ClientService->>CookieService: resolve/build cookie name
CookieService-->>ClientService: cookie_name
ClientService->>DB: persist cookie_name on client
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # CHANGELOG.md
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@seacatauth/client/schema.py`:
- Around line 22-27: CLIENT_METADATA_SCHEMA currently exposes "cookie_name" to
external input (so UPDATE_CLIENT and register flows accept and persist it);
remove "cookie_name" from CLIENT_METADATA_SCHEMA (and any register/update input
schemas) so external requests can't set it, and instead have the server-side
client creation/update code set/persist the cookie name internally: update the
service routines that persist client metadata (e.g., the functions handling
client registration/update in seacatauth/client/service.py such as the code path
referenced around the update flow) to compute and assign the canonical
cookie_name before saving; ensure UPDATE_CLIENT/REGISTER handlers no longer read
cookie_name from request payload but ignore or reject it so only system-managed
values are stored and later used by cookie resolution code.
- Line 24: The regex pattern in the schema ("pattern" value containing
"^[a-zA-Z0-9\\._]{,64}$") uses the Python-only quantifier "{,64}" which is
invalid in ECMA-262; update the pattern string in schema.py (the "pattern"
entry) to use the explicit lower bound quantifier "{0,64}" so it is valid in
JavaScript/browser validators and preserves the same behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 09206142-2989-44a0-82b1-921578f3ca31
📒 Files selected for processing (3)
CHANGELOG.mdseacatauth/client/schema.pyseacatauth/client/service.py
client_cookie a persistent client attributeclient_cookie a persistent and editable client attribute
Summary by CodeRabbit