MCPcopy
hub / github.com/lxc/incus / createRefreshToken

Method createRefreshToken

test/mini-oidc/storage/storage.go:602–618  ·  view source on GitHub ↗

createRefreshToken will store a refresh_token in-memory based on the provided information

(accessToken *Token, amr []string, authTime time.Time)

Source from the content-addressed store, hash-verified

600
601// createRefreshToken will store a refresh_token in-memory based on the provided information
602func (s *Storage) createRefreshToken(accessToken *Token, amr []string, authTime time.Time) (string, error) {
603 s.lock.Lock()
604 defer s.lock.Unlock()
605 token := &RefreshToken{
606 ID: accessToken.RefreshTokenID,
607 Token: accessToken.RefreshTokenID,
608 AuthTime: authTime,
609 AMR: amr,
610 ApplicationID: accessToken.ApplicationID,
611 UserID: accessToken.Subject,
612 Audience: accessToken.Audience,
613 Expiration: time.Now().Add(s.refreshTokenExpiration),
614 Scopes: accessToken.Scopes,
615 }
616 s.refreshTokens[token.ID] = token
617 return token.Token, nil
618}
619
620// renewRefreshToken checks the provided refresh_token and creates a new one based on the current
621func (s *Storage) renewRefreshToken(currentRefreshToken string) (string, string, error) {

Callers 2

exchangeRefreshTokenMethod · 0.95

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected