(config oauthAuthenticatorConfig, tokenResponse *tokenResponse)
| 125 | } |
| 126 | |
| 127 | func (a OAuthAuthenticator) updateTokenResponseCache(config oauthAuthenticatorConfig, tokenResponse *tokenResponse) { |
| 128 | cacheKey := a.accessTokenCacheKey(config) |
| 129 | a.cache.Set(cacheKey, tokenResponse.AccessToken, tokenResponse.ExpiresAt.Add(-TokenExpiryGracePeriod)) |
| 130 | |
| 131 | if tokenResponse.RefreshToken != nil { |
| 132 | refreshTokenCacheKey := a.refreshTokenCacheKey(config) |
| 133 | a.cache.Set(refreshTokenCacheKey, *tokenResponse.RefreshToken, time.Now().UTC().Add(refreshTokenDefaultExpiry-TokenExpiryGracePeriod)) |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | func (a OAuthAuthenticator) accessTokenCacheKey(config oauthAuthenticatorConfig) string { |
| 138 | identityBaseUri := config.IdentityUri |
no test coverage detected