Append services to apple external oauth#32
Conversation
WalkthroughA new record was appended to both the PCR device and production history JSON files, reflecting updated PCR hash values and timestamps. In the OAuth callback flow for Apple sign-in, the client ID is now checked and, if necessary, modified to ensure it ends with ".services", with a debug log added to capture this adjustment. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WebApp
participant AppleOAuth
User->>WebApp: Initiate Apple OAuth callback
WebApp->>WebApp: Retrieve client_id from settings
WebApp->>WebApp: If client_id does not end with ".services", append ".services"
WebApp->>WebApp: Log debug message if modified
WebApp->>AppleOAuth: Continue OAuth flow with (possibly modified) client_id
AppleOAuth-->>WebApp: Respond with authentication result
WebApp-->>User: Complete sign-in process
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (3)
⏰ Context from checks skipped due to timeout of 100000ms (1)
🔇 Additional comments (3)
✨ Finishing Touches
🧪 Generate Unit Tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
PR Summary
This PR modifies the Apple OAuth implementation to append '.services' to client IDs for web-based authentication flows, ensuring compatibility with Apple's authentication requirements.
- Added logic in
src/web/oauth_routes.rsto dynamically append '.services' to Apple client IDs for web flows - Updated PCR measurements in
pcrProd.jsonandpcrDev.jsonto reflect OAuth configuration changes - Added new PCR measurement entries in history files with timestamps 1747766237 (prod) and 1747766223 (dev)
- Maintained PCR1 constant across all updates while modifying PCR0 and PCR2 to reflect application changes
5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
| if !client_id.ends_with(".services") { | ||
| client_id = format!("{}.services", client_id); | ||
| debug!("Modified Apple client ID for web flow: {}", client_id); | ||
| } |
There was a problem hiding this comment.
style: Consider adding validation to ensure client_id is not empty before appending .services
| if !client_id.ends_with(".services") { | |
| client_id = format!("{}.services", client_id); | |
| debug!("Modified Apple client ID for web flow: {}", client_id); | |
| } | |
| if !client_id.is_empty() && !client_id.ends_with(".services") { | |
| client_id = format!("{}.services", client_id); | |
| debug!("Modified Apple client ID for web flow: {}", client_id); | |
| } else if client_id.is_empty() { | |
| error!("Empty Apple client ID"); | |
| return Err(ApiError::BadRequest); | |
| } |
Summary by CodeRabbit