MCPcopy
hub / github.com/golang-jwt/jwt / makeToken

Function makeToken

rsa_pss_test.go:134–145  ·  view source on GitHub ↗
(method jwt.SigningMethod)

Source from the content-addressed store, hash-verified

132}
133
134func makeToken(method jwt.SigningMethod) string {
135 token := jwt.NewWithClaims(method, jwt.RegisteredClaims{
136 Issuer: "example",
137 IssuedAt: jwt.NewNumericDate(time.Now()),
138 })
139 privateKey := test.LoadRSAPrivateKeyFromDisk("test/sample_key")
140 signed, err := token.SignedString(privateKey)
141 if err != nil {
142 panic(err)
143 }
144 return signed
145}
146
147func verify(t *testing.T, signingMethod jwt.SigningMethod, token string) bool {
148 segments := strings.Split(token, ".")

Callers 1

Calls 2

SignedStringMethod · 0.80

Tested by

no test coverage detected