MCPcopy Index your code
hub / github.com/coder/coder / newToken

Method newToken

coderd/coderdtest/oidctest/idp.go:836–849  ·  view source on GitHub ↗

newToken enforces the access token exchanged is actually a valid access token created by the IDP.

(t testing.TB, email string, expires time.Time)

Source from the content-addressed store, hash-verified

834// newToken enforces the access token exchanged is actually a valid access token
835// created by the IDP.
836func (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
851func (f *FakeIDP) newRefreshTokens(email string) string {
852 refreshToken := uuid.NewString()

Callers 1

httpHandlerMethod · 0.95

Calls 2

encodeClaimsMethod · 0.95
StoreMethod · 0.45

Tested by

no test coverage detected