Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultRefreshTokenPayloadLength = 64 TokenDelimer = "/" )
Variables ¶
Functions ¶
Types ¶
type RefreshTokenGenerator ¶
func (RefreshTokenGenerator) Generate ¶
func (g RefreshTokenGenerator) Generate() ([]byte, error)
type RefreshTokenRepo ¶
type RefreshTokenRepo interface { // Create generates and returns a new refresh token for the given client-user pair. // On success the token will be return. Create(userID, clientID string) (string, error) // Verify verifies that a token belongs to the client, and returns the corresponding user ID. // Note that this assumes the client validation is currently done in the application layer, Verify(clientID, token string) (string, error) // Revoke deletes the refresh token if the token belongs to the given userID. Revoke(userID, token string) error // RevokeTokensForClient revokes all tokens issued for the userID for the provided client. RevokeTokensForClient(userID, clientID string) error // ClientsWithRefreshTokens returns a list of all clients the user has an outstanding client with. ClientsWithRefreshTokens(userID string) ([]client.Client, error) }
Click to show internal directories.
Click to hide internal directories.