Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

feat: support string array in OAuth aud claim #2

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

emilhdiaz
Copy link
Contributor

Description of changes:

As per rfc7519:

In the general case, the "aud" value is an array of case-
sensitive strings, each containing a StringOrURI value. In the
special case when the JWT has one audience, the "aud" value MAY be a
single case-sensitive string containing a StringOrURI value.

This change allows the aud claim in the access_token JWT to be either a string or string[] (string array).

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@emilhdiaz emilhdiaz force-pushed the audience-array branch 2 times, most recently from 40d899a to 9402fb8 Compare November 10, 2020 16:42
src/smartConfig.ts Outdated Show resolved Hide resolved
src/smartHandler.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@rsmayda rsmayda 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!

Copy link
Contributor

@rsmayda rsmayda left a comment

Choose a reason for hiding this comment

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

Whoops forgot to ask can you add a test case for when aud is an array?

@emilhdiaz
Copy link
Contributor Author

Ah yep, just did. It's my first time writing unit tests in jest, so hopefully I implemented the tests correctly.

@emilhdiaz emilhdiaz requested a review from rsmayda November 11, 2020 16:58
Copy link
Contributor

@rsmayda rsmayda left a comment

Choose a reason for hiding this comment

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

Unit tests look good! Thanks

@rsmayda rsmayda merged commit 8273f16 into awslabs:mainline Nov 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants