fix: passkey rpid detect - #1934
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughOrigins handling for passkeys changes from a string slice to a single comma-separated string across backend and frontend. Backend parsing trims and validates entries, with fallback auto-detection. Settings now lazily derive RP ID from server address if absent. Frontend form submits passkey fields directly, with origins as a plain string input. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Admin as Admin UI
participant UI as Settings Form
participant API as Server API
participant CFG as Settings Store
participant SVC as Passkey Service
Admin->>UI: Edit Passkey fields (origins string, rp_id, etc.)
UI->>API: Submit settings payload
API->>CFG: Persist passkey settings
Note over CFG,SVC: Origins stored as comma-separated string
API-->>UI: 200 OK
SVC->>CFG: Load PasskeySettings
alt RPID empty and ServerAddress present
SVC->>SVC: Derive RPID from ServerAddress host
end
SVC->>SVC: Parse settings.Origins by comma, trim, validate
alt No valid origins
SVC->>SVC: Auto-detect origins (fallback)
end
SVC-->>SVC: Use resolved origins
sequenceDiagram
autonumber
participant SVC as Passkey Service
participant VAL as Origin Validator
SVC->>SVC: Read settings.Origins (string)
alt Non-empty
SVC->>SVC: Split by comma, trim whitespace
loop For each entry
SVC->>VAL: Validate origin / insecure checks
VAL-->>SVC: Accept/Reject
end
alt None accepted
SVC->>SVC: Auto-detect origins
end
else Empty
SVC->>SVC: Auto-detect origins
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
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. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
fix: passkey rpid detect
Summary by CodeRabbit
New Features
Refactor