Skip to content

Conversation

gaokevin1
Copy link
Member

@gaokevin1 gaokevin1 commented Oct 6, 2025

Related Issues

Fixes <link_to_github_issue>

Description

Added scopes to the main AuthenticationInfo interface, so it's easier to check and get scopes in the token.

You can use claims but I think we should have a dedicated variable here. Will only apply to OIDC-compliant tokens that include scope claims.

Must

  • Tests
  • Documentation (if applicable)

@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 15:57
Copy link
Contributor

@Copilot Copilot AI left a comment

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 adds scopes support to the authentication system by extending the Token interface and AuthenticationInfo to include a scopes field, along with adding a new VerifyOptions interface for JWT verification. The implementation includes utility functions for scope validation and retrieval.

  • Adds scopes field to Token interface and VerifyOptions interface for JWT verification
  • Implements scope validation functions (hasScopes, getMatchedScopes) with corresponding SDK methods
  • Updates JWT validation methods to accept optional verification options

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
lib/types.ts Adds scopes field to Token interface and defines new VerifyOptions interface
lib/index.ts Updates JWT validation methods to accept VerifyOptions and adds scope validation methods to SDK
lib/helpers.ts Implements utility functions for scope extraction and validation
lib/constants.ts Defines the scopes claim name constant

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

1 participant