Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSG-4625 validate jwt audience #89

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

tdeshong
Copy link
Contributor

What's New?

Add validation for jwt audience.

  • checks if audience exists
  • checks that audience is the app id (similar to the python sdk)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have manually tested my code thoroughly
  • I have added/updated inline documentation for public facing interfaces if relevant
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing integration and unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

go.mod Outdated Show resolved Hide resolved
@@ -105,5 +106,14 @@ func (a *App) ValidateAuthToken(authToken string) (string, bool) {
return "", false
}

audience, ok := claims["aud"].([]string)
Copy link
Contributor

Choose a reason for hiding this comment

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

the aud value may be a []string or string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call out! Will keep this in mind with the other languages as well.

authentication.go Outdated Show resolved Hide resolved
@tdeshong tdeshong marked this pull request as draft October 18, 2024 16:33
Copy link

sonarcloud bot commented Oct 18, 2024

@tdeshong tdeshong marked this pull request as ready for review October 18, 2024 17:05
@tdeshong tdeshong marked this pull request as draft October 29, 2024 18:49
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