Documentation ¶
Index ¶
- func ValidatePermissions(perms ...string) (valid bool, messages map[string]string)
- type AuthService
- func (s *AuthService) Callback(c *gin.Context, ctx context.Context, ...) (token string, err error)
- func (s *AuthService) Login(provider string) (redirect string, err error)
- func (s *AuthService) Token(ctx context.Context, subject string) (token *pkgModels.Token, err error)
- func (s *AuthService) Verify(tok string) (bool, jwt.Token)
- type PermissionsService
- type UserService
- func (s *UserService) CreateUser(ctx context.Context, in *models.User) (out *models.User, err error)
- func (s *UserService) DeleteUser(ctx context.Context, sub string) error
- func (s *UserService) GetUser(ctx context.Context, sub string) (out *models.User, err error)
- func (s *UserService) ListUsers(ctx context.Context) (out []*models.User, err error)
- func (s *UserService) UpdateUser(ctx context.Context, in *models.User, sub string) (out *models.User, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
AuthService contains auth related operations
func NewAuthService ¶
func NewAuthService(log *zerolog.Logger, userService *UserService, permService *PermissionsService, options *models.AuthOptions) *AuthService
NewAuthService configures a new instance of AuthService
func (*AuthService) Callback ¶
func (s *AuthService) Callback(c *gin.Context, ctx context.Context, provider, state, code, callbackErr, errDescription string) (token string, err error)
Callback processes the OIDC flow return values
func (*AuthService) Login ¶
func (s *AuthService) Login(provider string) (redirect string, err error)
Login gets the OIDC login URL for the given provider
type PermissionsService ¶
type PermissionsService struct {
// contains filtered or unexported fields
}
func NewPermissionsService ¶
func NewPermissionsService(log *zerolog.Logger, options *models.PermissionsOptions) *PermissionsService
NewPermissionService initialises a new PermissionService based on the options supplied
func (*PermissionsService) DefaultPermissions ¶
func (s *PermissionsService) DefaultPermissions() (out []string)
func (*PermissionsService) ListPermissions ¶
func (s *PermissionsService) ListPermissions() (out []string, err error)
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(log *zerolog.Logger, backend backends.Backend) *UserService
NewUserService initialises a new UserService based on the options supplied
func (*UserService) CreateUser ¶
func (s *UserService) CreateUser(ctx context.Context, in *models.User) (out *models.User, err error)
CreateUser uses the configured backend to create the supplied user after having validted it
func (*UserService) DeleteUser ¶
func (s *UserService) DeleteUser(ctx context.Context, sub string) error
DeleteUser uses the configured backend to mark the user as deleted
func (*UserService) GetUser ¶
GetUser uses the configured backend to get a single user based on it's subject claim
Click to show internal directories.
Click to hide internal directories.