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

[CHANGE] [AC] flip aud and sub for consistency #3784

Merged
merged 1 commit into from Jan 17, 2023
Merged

Conversation

aricart
Copy link
Member

@aricart aricart commented Jan 13, 2023

The auth request, the sub for the JWT is nats-authorization-request, and the aud is the nkey, typically our JWTs have sub be an identity and the aud is just a string describing where this jwt is applicable.

/cc @nats-io/core

@neilalexander
Copy link
Member

Looks like the target branch should be dev and not main?

@aricart aricart changed the base branch from main to dev January 13, 2023 16:22
@aricart
Copy link
Member Author

aricart commented Jan 13, 2023

Looks like the target branch should be dev and not main?

correct and vendor stuff too - we should default to dev.

// Build our request claims.
claim := jwt.NewAuthorizationRequestClaims(AuthRequestSubject)
// Build our request claims - jwt subject should be nkey
jwtSub := acc.Name
Copy link
Member Author

Choose a reason for hiding this comment

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

Also wondering if this really should acc.NKey and name is a last resort.

@aricart aricart marked this pull request as draft January 13, 2023 16:27
@derekcollison
Copy link
Member

Let's redo this to target dev..

@aricart
Copy link
Member Author

aricart commented Jan 14, 2023

Let's redo this to target dev..

it is

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM - Flip out of draft mode and we can merge.

@aricart aricart marked this pull request as ready for review January 17, 2023 16:11
@derekcollison derekcollison self-requested a review January 17, 2023 17:51
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 4e4a2d7 into dev Jan 17, 2023
@derekcollison derekcollison deleted the flip-aud-sub branch January 17, 2023 17:51
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.

None yet

3 participants