claimsAuthentic returns an authentic claim set that contains both primary and secondary claims.
()
| 346 | // claimsAuthentic returns an authentic claim set that contains both primary |
| 347 | // and secondary claims. |
| 348 | func claimsAuthentic() claimSet { |
| 349 | primaryClaims := jwt.Claims{ |
| 350 | ID: "id0123456789", |
| 351 | Subject: "noah", |
| 352 | Audience: jwt.Audience{"aud1", "aud2", "aud3", "baz"}, |
| 353 | IssuedAt: jwt.NewNumericDate(time.Now()), |
| 354 | Expiry: jwt.NewNumericDate(time.Now().Add(5 * time.Minute)), |
| 355 | } |
| 356 | secondaryClaims := map[string]interface{}{"email": "noah@foo.com"} |
| 357 | return claimSet{ |
| 358 | primaryClaims: primaryClaims, |
| 359 | secondaryClaims: secondaryClaims, |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | // claimsAuthenticWithUsernameClaim returns an authentic claim set after |
| 364 | // setting the given secondary claims. |
no test coverage detected