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

Replace JWT library for signing tokens #1308

Merged
merged 5 commits into from
Feb 28, 2024

Conversation

mantas-sidlauskas
Copy link
Contributor

What changed?

Why?
To align with upcoming server changes

How did you test it?
Unit tests

Potential risks

Copy link
Contributor

@3vilhamster 3vilhamster left a comment

Choose a reason for hiding this comment

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

Have some questions, but overall looks ok.

internal/common/auth/service_wrapper.go Outdated Show resolved Hide resolved
@@ -22,6 +22,7 @@ package auth

import (
"context"
"github.com/golang-jwt/jwt/v5"
Copy link
Contributor

Choose a reason for hiding this comment

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

separate std imports from others.

Unrelated @Groxx Should we onboard client to gci too?

if err != nil {
return nil, err

ttl := int64(60 * 10)
Copy link
Contributor

Choose a reason for hiding this comment

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

why it is hardcoded? Should it be configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No sure why this was hard-coded during the initial implementation but my take is this: this ttl is for internal/self-signed tokens. There are no external calls to acquire a token, there's no caching involved, they are issued for every request, in other words, they are cheap and should be short lived.

@@ -21,60 +21,41 @@
package internal

import (
"encoding/json"
"io/ioutil"
"github.com/stretchr/testify/assert"
Copy link
Contributor

Choose a reason for hiding this comment

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

goimports

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@3vilhamster 3vilhamster left a comment

Choose a reason for hiding this comment

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

LGTM

@demirkayaender demirkayaender merged commit 4985100 into uber-go:master Feb 28, 2024
9 checks passed
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.

4 participants