Documentation
¶
Index ¶
- func GenerateRefreshToken() (string, error)
- type Client
- type RefreshToken
- type Store
- func (s *Store) AddClient(clientID, clientName, secretPlain string, confidential bool, ...) error
- func (s *Store) AddRole(username, role string) error
- func (s *Store) AddUser(username, password, email, displayName string) error
- func (s *Store) Authenticate(username, password string) (*User, error)
- func (s *Store) AuthenticateClient(clientID, secret string) (*Client, error)
- func (s *Store) CleanupExpiredRefreshTokens(olderThan time.Duration) (int64, error)
- func (s *Store) CleanupRateLimits(olderThan time.Duration) (int64, error)
- func (s *Store) CleanupTokenRevocations() (int64, error)
- func (s *Store) ClientCount() (int, error)
- func (s *Store) Close() error
- func (s *Store) ConsumeRefreshToken(rawToken string) (string, string, error)
- func (s *Store) CountAttempts(key string, window time.Duration) (int, error)
- func (s *Store) DB() *sql.DB
- func (s *Store) DeleteClient(clientID string) error
- func (s *Store) DeleteConfig(key string) error
- func (s *Store) DeleteUser(username string) error
- func (s *Store) GetAllConfig() (map[string]string, error)
- func (s *Store) GetClient(clientID string) (*Client, error)
- func (s *Store) GetConfig(key string) (string, error)
- func (s *Store) GetConfigMap(key string) (map[string]string, error)
- func (s *Store) GetConfigStringSlice(key string) ([]string, error)
- func (s *Store) GetUser(username string) (*User, error)
- func (s *Store) GetUserByID(id string) (*User, error)
- func (s *Store) IsAccessTokenRevoked(tokenHash string) bool
- func (s *Store) ListClients() []Client
- func (s *Store) ListRoles(username string) ([]string, error)
- func (s *Store) ListUsers() []User
- func (s *Store) RecordAttempt(key string) error
- func (s *Store) RemoveRole(username, role string) error
- func (s *Store) ResetPassword(username, password string) error
- func (s *Store) RevokeAccessToken(tokenHash string, expiresAt time.Time) error
- func (s *Store) RevokeRefreshToken(rawToken string) error
- func (s *Store) RevokeRefreshTokensForUser(userID string) error
- func (s *Store) SetConfig(key, value string) error
- func (s *Store) SetConfigMap(key string, m map[string]string) error
- func (s *Store) SetConfigStringSlice(key string, values []string) error
- func (s *Store) StoreRefreshToken(rawToken, userID, clientID string, lifetime time.Duration) (string, error)
- func (s *Store) UpdateClient(clientID, clientName string, redirectURIs, grantTypes []string) error
- func (s *Store) UpdateUser(username, email, displayName string) error
- func (s *Store) UserCount() (int, error)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRefreshToken ¶
Types ¶
type Client ¶
type Client struct {
ClientID string `json:"clientId"`
ClientName string `json:"clientName"`
SecretHash string `json:"secretHash,omitempty"`
Confidential bool `json:"confidential"`
RedirectURIs []string `json:"redirectURIs"`
AllowedGrantTypes []string `json:"allowedGrantTypes"`
CreatedAt string `json:"createdAt"`
}
func (*Client) HasGrantType ¶
ClientHasGrantType checks if a client is allowed a grant type
func (*Client) IsValidRedirectURI ¶
IsValidRedirectURI checks if a redirect URI is allowed for a client
type RefreshToken ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AuthenticateClient ¶
AuthenticateClient checks client_id + secret for confidential clients
func (*Store) CleanupExpiredRefreshTokens ¶
func (*Store) CleanupRateLimits ¶
CleanupRateLimits removes old rate limit entries
func (*Store) CleanupTokenRevocations ¶
func (*Store) ClientCount ¶
func (*Store) ConsumeRefreshToken ¶
func (*Store) CountAttempts ¶
CountAttempts counts attempts for a key within a window
func (*Store) DeleteClient ¶
func (*Store) DeleteConfig ¶
func (*Store) DeleteUser ¶
func (*Store) GetConfigStringSlice ¶
func (*Store) IsAccessTokenRevoked ¶
func (*Store) ListClients ¶
func (*Store) RecordAttempt ¶
RecordAttempt records a rate limit attempt
func (*Store) RemoveRole ¶
func (*Store) ResetPassword ¶
func (*Store) RevokeAccessToken ¶
func (*Store) RevokeRefreshToken ¶
func (*Store) RevokeRefreshTokensForUser ¶
func (*Store) SetConfigStringSlice ¶
func (*Store) StoreRefreshToken ¶
func (*Store) UpdateClient ¶
func (*Store) UpdateUser ¶
Click to show internal directories.
Click to hide internal directories.