makeToken creates a default token with an expiry of 5 minutes.
(claimSet claimSet)
| 330 | |
| 331 | // makeToken creates a default token with an expiry of 5 minutes. |
| 332 | func (s *mockAuthServer) makeToken(claimSet claimSet) (string, error) { |
| 333 | primaryClaims := claimSet.primaryClaims |
| 334 | secondaryClaims := claimSet.secondaryClaims |
| 335 | if primaryClaims.Issuer == "" { |
| 336 | primaryClaims.Issuer = s.options.issuer |
| 337 | } |
| 338 | builder := jwt.Signed(s.signer).Claims(primaryClaims).Claims(secondaryClaims) |
| 339 | token, err := builder.Serialize() |
| 340 | if err != nil { |
| 341 | return "", err |
| 342 | } |
| 343 | return token, nil |
| 344 | } |
| 345 | |
| 346 | // claimsAuthentic returns an authentic claim set that contains both primary |
| 347 | // and secondary claims. |
no outgoing calls
no test coverage detected