Enhance logging and repair flow for FPSSO#49524
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves observability and resiliency of the Fleet Platform SSO (PSSO) macOS extension by adding unified logging and making the registration flow more robust during headless/background repair scenarios.
Changes:
- Introduces a shared
os.Loggerfor the PSSO extension and adds step-level logging across registration/config/networking paths. - Enhances device registration repair behavior by resetting device keys when
.registrationRepairis requested. - Makes user registration more tolerant of missing
userNameduring background repairs by falling back to the persisted user login configuration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| apps/fleet-desktop-macos/FleetPSSOExtension/AuthenticationViewController.swift | Adds a shared Logger instance and guidance on logging privacy for headless flows. |
| apps/fleet-desktop-macos/FleetPSSOExtension/AuthenticationViewController+Shared.swift | Adds error logging around invalid BaseURL and missing JWKS encryption key. |
| apps/fleet-desktop-macos/FleetPSSOExtension/AuthenticationViewController+PSSO.swift | Adds logging for registration steps, improves repair handling, and adds username fallback logic. |
| apps/fleet-desktop-macos/FleetPSSOExtension/AuthenticationViewController+Networking.swift | Adds structured logging and clearer failure reasons for JWKS fetch/decode and registration POST. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThe PSSO extension adds a shared OS logger and records failures during configuration, key loading, networking, and registration. JWKS retrieval and device-registration requests now explicitly validate HTTP responses and handle fetch, decoding, and response errors. Device registration validates keys, tokens, and payload fields, while user registration supports username fallback and distinguishes failed registration from required user interaction. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
Would this not require a version bump? Or |
We have a 1.4.0 version bump coming in another PR so I think it's OK. The overall version will be bumped versus the last customer facing release |
Related issue: Resolves #
Checklist for submitter
If some of the following don't apply, delete the relevant line.
Unreleased bug so no changes file
Changes file added for user-visible changes in
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Input data is properly validated,
SELECT *is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.Testing
Summary by CodeRabbit
Bug Fixes
Diagnostics