Documentation
¶
Index ¶
- Variables
- func NewKeycloakRepository(cfg *config.IdentityAuthConfig) storage.AuthRepository
- func NewUserRepository(cfg *config.IdentityAuthConfig) storage.UserRepository
- type KeycloakRepository
- func (r *KeycloakRepository) GetAccessTokenFromClientCode(ctx context.Context, code, redirectURL string) (*entities.ClientToken, error)
- func (r *KeycloakRepository) GetAccessTokenFromClientCredentials(ctx context.Context, clientID, clientSecret string) (*entities.ClientToken, error)
- func (r *KeycloakRepository) RefreshToken(ctx context.Context, refreshToken string) (*entities.ClientToken, error)
- func (r *KeycloakRepository) RetrospectToken(ctx context.Context, token string) (*entities.IntroSpectTokenResult, error)
- type UserRepository
- func (r *UserRepository) Create(ctx context.Context, user *entities.User, password string, roles []string) (*entities.User, error)
- func (r *UserRepository) GetAll(ctx context.Context) ([]*entities.User, error)
- func (r *UserRepository) GetByIDs(ctx context.Context, ids []string) ([]*entities.User, error)
- func (r *UserRepository) RemoveSession(ctx context.Context, refreshToken string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidToken = errors.New("invalid token") ErrTokenExpired = errors.New("token expired") ErrTokenNotActive = errors.New("token not active") ErrTokenInvalidType = errors.New("token invalid type") ErrLogin = errors.New("failed to login to keycloak") ErrLogout = errors.New("failed to logout") ErrEmptyUser = errors.New("user is nil") ErrGetUser = errors.New("failed to get user") ErrCreateUser = errors.New("failed to create user") ErrSetPassword = errors.New("failed to set password") ErrGetRole = errors.New("failed to get role by name") ErrSetRole = errors.New("failed to assign role") ErrParseID = errors.New("failed to parse user id") ErrUserWithNilAttributes = errors.New("user with empty attributes") )
Functions ¶
func NewKeycloakRepository ¶
func NewKeycloakRepository(cfg *config.IdentityAuthConfig) storage.AuthRepository
func NewUserRepository ¶
func NewUserRepository(cfg *config.IdentityAuthConfig) storage.UserRepository
Types ¶
type KeycloakRepository ¶
type KeycloakRepository struct {
// contains filtered or unexported fields
}
func (*KeycloakRepository) GetAccessTokenFromClientCode ¶
func (r *KeycloakRepository) GetAccessTokenFromClientCode(ctx context.Context, code, redirectURL string) (*entities.ClientToken, error)
func (*KeycloakRepository) GetAccessTokenFromClientCredentials ¶ added in v1.1.0
func (r *KeycloakRepository) GetAccessTokenFromClientCredentials(ctx context.Context, clientID, clientSecret string) (*entities.ClientToken, error)
func (*KeycloakRepository) RefreshToken ¶
func (r *KeycloakRepository) RefreshToken(ctx context.Context, refreshToken string) (*entities.ClientToken, error)
func (*KeycloakRepository) RetrospectToken ¶
func (r *KeycloakRepository) RetrospectToken(ctx context.Context, token string) (*entities.IntroSpectTokenResult, error)
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func (*UserRepository) RemoveSession ¶
func (r *UserRepository) RemoveSession(ctx context.Context, refreshToken string) error
Click to show internal directories.
Click to hide internal directories.