newToken enforces the access token exchanged is actually a valid access token created by the IDP.
(t testing.TB, email string, expires time.Time)
| 834 | // newToken enforces the access token exchanged is actually a valid access token |
| 835 | // created by the IDP. |
| 836 | func (f *FakeIDP) newToken(t testing.TB, email string, expires time.Time) string { |
| 837 | accessToken := uuid.NewString() |
| 838 | if f.hookAccessTokenJWT != nil { |
| 839 | claims := f.hookAccessTokenJWT(email, expires) |
| 840 | accessToken = f.encodeClaims(t, claims) |
| 841 | } |
| 842 | |
| 843 | f.accessTokens.Store(accessToken, token{ |
| 844 | issued: time.Now(), |
| 845 | email: email, |
| 846 | exp: expires, |
| 847 | }) |
| 848 | return accessToken |
| 849 | } |
| 850 | |
| 851 | func (f *FakeIDP) newRefreshTokens(email string) string { |
| 852 | refreshToken := uuid.NewString() |
no test coverage detected