Skip to content

Allow get_access_token to return tokens with multiple scopes#7357

Open
mhammond wants to merge 2 commits intomozilla:mainfrom
mhammond:push-lyyuprzszwut
Open

Allow get_access_token to return tokens with multiple scopes#7357
mhammond wants to merge 2 commits intomozilla:mainfrom
mhammond:push-lyyuprzszwut

Conversation

@mhammond
Copy link
Copy Markdown
Member

@mhammond mhammond commented May 8, 2026

This brings mobile in line with desktop. Multiple scopes can be specified. These scopes are normalized and used as the cache key.

Split into 2 commits for ease of review:

  • first patch with the changes
  • second patch splits the access token code and tests into its own module, so oauth.rs stays a sane size. This commit has no actual functionality change.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

@mhammond mhammond requested review from bendk and skhamis May 8, 2026 02:54
@mhammond mhammond force-pushed the push-lyyuprzszwut branch from c27ce0d to 9868242 Compare May 8, 2026 10:58
Copy link
Copy Markdown
Contributor

@bendk bendk left a comment

Choose a reason for hiding this comment

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

Looks good to me. I had a small suggestion, but no need for re-review.

}
}
let mut requested_scopes: Vec<&str> = requested_set.iter().copied().collect();
requested_scopes.sort_unstable();
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.

Nit: Now that we have normalize_scopes, I think this could just be let requested_scopes: Vec<&str> = requested.split_ascii_whitespace().collect().

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.

2 participants