Skip to content

Commit 520296a

Browse files
committed
jwtutil.ParsedKey signature
1 parent 04b94bc commit 520296a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

jwtutil/jwtutil.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ func Validate[T any, PT ClaimsPtr[T]](opts *ValidateOpts) (*jwt.Token, error) {
136136
//
137137

138138
type ParsedKey struct {
139-
Kid string
140-
Key any
139+
Kid string
140+
Public any
141141
}
142142

143143
func ParsePublicKey(keyPem []byte) (*ParsedKey, error) {
@@ -153,7 +153,7 @@ func ParsePublicKey(keyPem []byte) (*ParsedKey, error) {
153153
}
154154

155155
return &ParsedKey{
156-
Kid: kid,
157-
Key: key,
156+
Kid: kid,
157+
Public: key,
158158
}, nil
159159
}

jwtutil/jwtutil_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ func TestParsePublicKey(t *testing.T) {
621621
assert.NoError(t, err)
622622
assert.NotNil(t, parsed)
623623
assert.NotEmpty(t, parsed.Kid)
624-
assert.NotNil(t, parsed.Key)
624+
assert.NotNil(t, parsed.Public)
625625

626626
// Verify kid
627627
assert.Len(t, parsed.Kid, 64)
@@ -728,6 +728,6 @@ LMVPwTQHPwQ=
728728
assert.NoError(t, err)
729729
assert.NotNil(t, parsed)
730730
assert.NotEmpty(t, parsed.Kid)
731-
assert.NotNil(t, parsed.Key)
731+
assert.NotNil(t, parsed.Public)
732732
})
733733
}

0 commit comments

Comments
 (0)