Skip to content

Conversation

@NamanBalaji
Copy link

No description provided.

@push-tags-from-workflow push-tags-from-workflow bot added dependencies Pull requests that update a dependency file feature tests labels Nov 18, 2025
@NamanBalaji NamanBalaji force-pushed the feat/add-message-signing-package branch 3 times, most recently from cbb12c6 to 51875d6 Compare November 20, 2025 10:03
@NamanBalaji NamanBalaji self-assigned this Nov 20, 2025
@NamanBalaji NamanBalaji marked this pull request as ready for review November 20, 2025 10:06
@NamanBalaji NamanBalaji force-pushed the feat/add-message-signing-package branch from 51875d6 to 0f71483 Compare November 20, 2025 10:12
@sonarqubecloud
Copy link

Copy link
Contributor

@cb80 cb80 left a comment

Choose a reason for hiding this comment

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

Package signing is very much specific to JWT token, so I'd call it jwtsigning.

Copy link

@fabenan-f fabenan-f left a comment

Choose a reason for hiding this comment

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

just small test-related stuff

tb.Helper()

key, err := rsa.GenerateKey(rand.Reader, bits)
if err != nil {

Choose a reason for hiding this comment

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

Since we are using an assertion package everywhere, I'd stick with it for consistency reasons

assert.NoError(t, err)

body := []byte("message-body")
tokenStr, err := signer.Sign(context.Background(), body)

Choose a reason for hiding this comment

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

NIT: t.Context() (also at other places)

@cb80 cb80 requested a review from alienvspredator November 24, 2025 09:54
Copy link

@jithinkunjachan jithinkunjachan left a comment

Choose a reason for hiding this comment

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

Good work

return nil, ErrMissingIssOrKid
}

if len(v.trustedIssuers) > 0 {
Copy link

@jithinkunjachan jithinkunjachan Nov 24, 2025

Choose a reason for hiding this comment

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

We should return error early while initialization of the verifier itself cause if the trustedIssuers is empty or nil we might accept jwt token signed by any malicious entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file feature tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants