Skip to content

Enhance logging and repair flow for FPSSO#49524

Merged
JordanMontgomery merged 1 commit into
mainfrom
JM-fpsso-enhancements
Jul 20, 2026
Merged

Enhance logging and repair flow for FPSSO#49524
JordanMontgomery merged 1 commit into
mainfrom
JM-fpsso-enhancements

Conversation

@JordanMontgomery

@JordanMontgomery JordanMontgomery commented Jul 17, 2026

Copy link
Copy Markdown
Member

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/ or ee/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

  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • Bug Fixes

    • Improved device and user registration reliability with clearer validation and error handling.
    • Added fallback username resolution when registration details are incomplete.
    • Registration now appropriately requests user interaction when required.
  • Diagnostics

    • Added structured logging for network failures, invalid responses, missing credentials, configuration errors, and registration outcomes.

@JordanMontgomery
JordanMontgomery marked this pull request as ready for review July 17, 2026 20:58
Copilot AI review requested due to automatic review settings July 17, 2026 20:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Logger for the PSSO extension and adds step-level logging across registration/config/networking paths.
  • Enhances device registration repair behavior by resetting device keys when .registrationRepair is requested.
  • Makes user registration more tolerant of missing userName during 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.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fea11e9c-6aaa-4624-87c2-243574116058

📥 Commits

Reviewing files that changed from the base of the PR and between 67c06a9 and 01c53b9.

📒 Files selected for processing (4)
  • apps/fleet-desktop-macos/FleetPSSOExtension/AuthenticationViewController+Networking.swift
  • apps/fleet-desktop-macos/FleetPSSOExtension/AuthenticationViewController+PSSO.swift
  • apps/fleet-desktop-macos/FleetPSSOExtension/AuthenticationViewController+Shared.swift
  • apps/fleet-desktop-macos/FleetPSSOExtension/AuthenticationViewController.swift

Walkthrough

The 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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete: the related issue is a placeholder and the Fleet Desktop checklist section is missing. Replace the placeholder issue reference with a real number or NA, and complete or remove any applicable Fleet Desktop checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: improved FPSSO logging and repair flow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch JM-fpsso-enhancements

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MagnusHJensen

Copy link
Copy Markdown
Member

Would this not require a version bump? Or

@JordanMontgomery

Copy link
Copy Markdown
Member Author

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

@JordanMontgomery
JordanMontgomery merged commit 4762dba into main Jul 20, 2026
11 checks passed
@JordanMontgomery
JordanMontgomery deleted the JM-fpsso-enhancements branch July 20, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants