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

Include UserId in leaf tokens #15

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func (a *SigningAuthority) Sign(audience string) (string, error) {
Slug: a.identity.Slug,
Aud: audience,
OriginReplid: a.identity.OriginReplid,
UserId: a.identity.UserId,
}

token, err := signIdentity(a.privateKey, a.signingAuthority, &replIdentity)
Expand Down
2 changes: 2 additions & 0 deletions sign_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ func TestAnyReplIDIdentity(t *testing.T) {
User: "user",
Slug: "slug",
Aud: "another-audience",
UserId: 1,
}

privkey, identity, err := identityTokenAnyRepl("repl", "user", "slug")
Expand Down Expand Up @@ -516,4 +517,5 @@ func TestAnyReplIDIdentity(t *testing.T) {
assert.Equal(t, "a-b-c-d", replIdentity.Replid)
assert.Equal(t, "user", replIdentity.User)
assert.Equal(t, "slug", replIdentity.Slug)
assert.Equal(t, int64(1), replIdentity.UserId)
}