signToken creates and returns a signed JWT token using signingMethod.
(claims jwt.Claims, signingMethod jwt.SigningMethod)
| 497 | |
| 498 | // signToken creates and returns a signed JWT token using signingMethod. |
| 499 | func signToken(claims jwt.Claims, signingMethod jwt.SigningMethod) string { |
| 500 | var privateKey any |
| 501 | switch signingMethod { |
| 502 | case jwt.SigningMethodRS256: |
| 503 | privateKey = jwtTestRSAPrivateKey |
| 504 | case jwt.SigningMethodES256: |
| 505 | privateKey = jwtTestEC256PrivateKey |
| 506 | default: |
| 507 | return "" |
| 508 | } |
| 509 | return test.MakeSampleToken(claims, signingMethod, privateKey) |
| 510 | } |
| 511 | |
| 512 | func TestParser_Parse(t *testing.T) { |
| 513 | // Iterate over test data set and run tests |
no test coverage detected