fix(nomad devices): validate signed automated login intents before checking server support #4664
Open
MohamadJaara wants to merge 1 commit intodevelopfrom
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



PR Submission Checklist for internal contributors
The PR Title
SQPIT-764The PR Description
What's new in this PR?
Issues
Automated Nomad login intents were not fully respecting server-side Nomad support.
The flow was gated by a local app/build flag instead of checking the backend capability through the proper auth use case.
The intent handling also needed the signature check to be the first meaningful validation step for the Nomad payload.
Causes (Optional)
The Nomad intent parser and the non-deeplink handling path relied on
NomadProfilesFeatureConfig, which only reflects local build configuration.Although
IsNomadProfilesEnabledUseCasealready existed, it was not wired into the automated Nomad intent flow.This made the client accept a signed Nomad intent without verifying that the target backend actually supports Nomad profiles.
Solutions
Updated the intent parser to validate the Nomad signature before accepting the payload.
Kept the parser strict so automated Nomad login requires both
backendConfigandssoCode.Updated
WireActivityViewModelto:IsNomadProfilesEnabledUseCasePreserved the existing
OnUnknownDeepLinkbehavior when backend config loading fails.Added and updated unit tests for:
Dependencies (Optional)
Needs releases with:
Testing
Test Coverage (Optional)
How to Test
Notes (Optional)
The flow still respects the local build flag in the view model as an additional gate, but the backend capability check is now mandatory before automatic Nomad login proceeds.
This PR mainly changes gating and validation order; it does not change the login payload structure.
Attachments (Optional)
flowchart TD A["Incoming non-deeplink intent"] --> B["Parse automated_login payload"] B --> C{"nomadProfilesHost present?"} C -- No --> X["Ignore intent"] C -- Yes --> D{"Signature valid?"} D -- No --> X D -- Yes --> E{"backendConfig and ssoCode present?"} E -- No --> X E -- Yes --> F{"Local Nomad flag enabled?"} F -- No --> X F -- Yes --> G["Load backend config"] G --> H{"Config loaded?"} H -- No --> I["Send OnUnknownDeepLink"] H -- Yes --> J["Create auth scope for backend"] J --> K["Call IsNomadProfilesEnabledUseCase"] K --> L{"Server supports Nomad?"} L -- No --> X L -- Yes --> M{"Existing valid session?"} M -- Yes --> N["Show blocked login toast"] M -- No --> O["Dispatch OnAutomaticLogin"]PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors