fix(security): enforce purpose scope validation for recovery tokens - #885
fix(security): enforce purpose scope validation for recovery tokens#885d-oit wants to merge 2 commits into
Conversation
Ensure that stateless JWT recovery tokens validate a concrete 'purpose'
claim ('reader_recover') on verify to enforce scope domain separation.
Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>
Deploying do-epub-studio with
|
| Latest commit: |
9099df9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ff81b162.do-epub-studio.pages.dev |
| Branch Preview URL: | https://jules-16229959289807015906-6.do-epub-studio.pages.dev |
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
✅ Health of changed files: 5.1 → 5.4 (+0.3) 📋 At a glance 📌 Before you merge
🔎 More signals (2)🗺️ Change map flowchart LR
subgraph PR ["Changed in this PR (1 with dependents)"]
f_apps_worker_src_routes_access_ts[".../routes/access.ts 🔥"]:::changed
end
f_apps_web_src_features_admin_BooksPage_tsx[".../admin/BooksPage.tsx"]
f_apps_worker_src_routes_access_ts --> f_apps_web_src_features_admin_BooksPage_tsx
f_apps_web_src_features_auth_LoginPage_tsx[".../auth/LoginPage.tsx"]
f_apps_worker_src_routes_access_ts --> f_apps_web_src_features_auth_LoginPage_tsx
f_apps_web_src_i18n_de_ts[".../i18n/de.ts"]
f_apps_worker_src_routes_access_ts --> f_apps_web_src_i18n_de_ts
f_apps_web_src_i18n_en_ts[".../i18n/en.ts"]
f_apps_worker_src_routes_access_ts --> f_apps_web_src_i18n_en_ts
more(["+4 more dependents"])
PR --> more
t_apps_worker_src___tests___middleware_test_ts(["✅ .../__tests__/middleware.test.ts"]):::guard
t_apps_worker_src___tests___middleware_test_ts -.-> f_apps_worker_src_routes_access_ts
classDef changed fill:#dbeafe,stroke:#1d4ed8,color:#1e3a5f
classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
classDef guard fill:#dcfce7,stroke:#15803d,color:#14532d
Solid arrows: code that imports the changed files (8 direct dependents, from the last indexed snapshot). Dashed: history/tests. 🔥 Hotspots touched (2)
📊 See the full report for this PR |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 7 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
🚀 Performance Report⚡ Startup & Interaction
🛠️ CI & Workflow
|
Ensure that stateless JWT recovery tokens validate a concrete 'purpose'
claim ('reader_recover') on verify to enforce scope domain separation.
Co-authored-by: d-oit <6849456+d-oit@users.noreply.github.com>
Enforced strict validation of the 'purpose' claim inside JWT magic link recovery tokens. During token generation, the payload now explicitly contains
purpose: 'reader_recover'. Upon verification on the/verify-recoveryendpoint, we strictly check for this claim, rejecting any tokens without or with incorrect purpose values. Updated recovery test fixtures and added unit tests covering verification with invalid/missing purposes.PR created automatically by Jules for task 16229959289807015906 started by @d-oit