We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3fa10fa commit 6951014Copy full SHA for 6951014
ksmjwt_localstack_test.go
@@ -10,6 +10,7 @@ import (
10
"github.com/aws/aws-sdk-go-v2/credentials"
11
"github.com/aws/aws-sdk-go-v2/service/kms"
12
"github.com/aws/aws-sdk-go-v2/service/kms/types"
13
+ "github.com/golang-jwt/jwt/v4"
14
"github.com/stretchr/testify/assert"
15
"github.com/stretchr/testify/require"
16
@@ -42,6 +43,19 @@ func TestWithLocalStack(t *testing.T) {
42
43
err = signer.Verify(in, signature, ctx)
44
assert.NoError(t, err, "verify")
45
})
46
+
47
+ t.Run("RFC compliance", func(t *testing.T) {
48
+ signer := kmsjwt.New(client.KMS, keyID)
49
50
+ signature, err := signer.Sign(in, ctx)
51
+ require.NoError(t, err, "sign")
52
53
+ builtinSigner := jwt.GetSigningMethod(signer.Alg())
54
+ require.NotNil(t, builtinSigner, "unknown algorithm")
55
56
+ err = builtinSigner.Verify(in, signature, publicKey)
57
+ assert.NoError(t, err, "verify")
58
+ })
59
}
60
61
func newClient(t *testing.T, ctx context.Context) Client {
0 commit comments