Documentation ¶
Index ¶
- Variables
- type ApplicationDTO
- type ApplicationService
- func (a *ApplicationService) AddFlow(ctx context.Context, clientID string, flow application.FlowType) error
- func (a *ApplicationService) AddLogoutURI(ctx context.Context, clientID string, logoutURI string) error
- func (a *ApplicationService) AddRedirectURI(ctx context.Context, clientID string, redirectURI string) error
- func (a *ApplicationService) ByClientID(ctx context.Context, clientID string) (*ApplicationDTO, error)
- func (a *ApplicationService) CreateApplication(ctx context.Context, clientID string, clientSecret string, name string, ...) (int, error)
- func (a *ApplicationService) List(ctx context.Context, page int, pageSize int, q string, sort string) (*PaginationResponse, error)
- func (a *ApplicationService) PurgeRetiredApplications(ctx context.Context) error
- func (a *ApplicationService) RemoveFlow(ctx context.Context, clientID string, flow application.FlowType) error
- func (a *ApplicationService) RemoveLogoutURI(ctx context.Context, clientID string, logoutURI string) error
- func (a *ApplicationService) RemoveRedirectURI(ctx context.Context, clientID string, redirectURI string) error
- func (a *ApplicationService) RetireApplication(ctx context.Context, clientID string) error
- func (a *ApplicationService) SetSecret(ctx context.Context, clientID string, secret string) error
- func (a *ApplicationService) TogglePKCE(ctx context.Context, clientID string, enable bool) error
- func (a *ApplicationService) WithActiveUserAuthorizations(ctx context.Context, userID uuid.UUID) ([]*ApplicationDTO, error)
- type AuthorizationApplicationDTO
- type AuthorizationDTO
- type AuthorizationService
- func (a *AuthorizationService) ActiveByUser(ctx context.Context, userID uuid.UUID) ([]*AuthorizationDTO, error)
- func (a *AuthorizationService) GrantAuthorization(ctx context.Context, userID uuid.UUID, clientID string, scope string) error
- func (a *AuthorizationService) List(ctx context.Context, page int, pageSize int, q string, sort string) (*PaginationResponse, error)
- func (a *AuthorizationService) RevokeAuthorizationByClientIDAndUserID(ctx context.Context, clientID string, userID uuid.UUID) error
- func (a *AuthorizationService) RevokeAuthorizationClientIDAndEmail(ctx context.Context, clientID string, email string) error
- type AuthorizationUserDTO
- type InviteApplicationDTO
- type InviteDTO
- type InviteService
- type PaginationResponse
- type RoleDTO
- type RoleService
- type UserDTO
- type UserService
- func (g *UserService) AddUserToRole(ctx context.Context, id uuid.UUID, role string) error
- func (g *UserService) BanUser(ctx context.Context, id uuid.UUID) error
- func (g *UserService) ByID(ctx context.Context, userID uuid.UUID) (*UserDTO, error)
- func (g *UserService) ConfirmUser(ctx context.Context, id uuid.UUID) error
- func (g *UserService) EmailToID(ctx context.Context, email string) (uuid.UUID, error)
- func (g *UserService) InitialUserInvite(ctx context.Context, inviteCode string, roles []string, appIds []int) error
- func (g *UserService) InsertUser(ctx context.Context, email string, password string, phone *string, ...) (uuid.UUID, error)
- func (g *UserService) InviteUser(ctx context.Context, email *string, roles []string, appIds []int) (generator.RandomTokenType, error)
- func (g *UserService) List(ctx context.Context, page int, pageSize int, q string, sort string) (*PaginationResponse, error)
- func (g *UserService) LockUser(ctx context.Context, id uuid.UUID, until time.Time) error
- func (g *UserService) RemoveUserFromRole(ctx context.Context, id uuid.UUID, role string) error
- func (g *UserService) UnbanUser(ctx context.Context, id uuid.UUID) error
- func (g *UserService) UnlockUser(ctx context.Context, id uuid.UUID) error
- func (g *UserService) VerifyUserInRole(ctx context.Context, userID uuid.UUID, role string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInviteOnly = errors.New( "behaivoural setting is set to only accept invited members", ) ErrTokenGenTimeout = errors.New("could not generate a token within given cycles") ErrEntityAlreadyExists = errors.New("entity already exists in system") ErrTokenExpired = errors.New("supplied token has expired") ErrEntityInvalidTransition = errors.New("entity does not support transition") ErrPasswordGuidelines = errors.New("password doesnt match password guidlines") ErrNotFound = errors.New("entity not found") )
View Source
var ErrAppIsRetired = errors.New("application is retired")
View Source
var ErrApplicationClientIDExists = errors.New("application with client_id already exists")
View Source
var ErrInvalidSecret = errors.New("invalid secret")
View Source
var ErrUserNotInRole = errors.New("user is not in role")
Functions ¶
This section is empty.
Types ¶
type ApplicationDTO ¶
type ApplicationDTO struct { ID int `json:"id"` ClientID string `json:"client_id"` Type string `json:"type"` Name string `json:"name"` Status string `json:"status"` Confidentiality string `json:"confidentiality"` HasSecret bool `json:"has_secret"` PKCE bool `json:"pkce"` Flows []string `json:"flows"` Scope string `json:"scope"` RedirectURIs []string `json:"redirect_uris"` LogoutURIs []string `json:"logout_uris"` }
func (*ApplicationDTO) Render ¶
func (*ApplicationDTO) Render(_ http.ResponseWriter, _ *http.Request) error
type ApplicationService ¶
type ApplicationService struct {
// contains filtered or unexported fields
}
func NewApplicationSevice ¶
func NewApplicationSevice(store *db.DataStore, log *zap.Logger, cfg *config.Configuration, dispatcher *events.Dispatcher) *ApplicationService
func (*ApplicationService) AddFlow ¶
func (a *ApplicationService) AddFlow( ctx context.Context, clientID string, flow application.FlowType, ) error
func (*ApplicationService) AddLogoutURI ¶
func (*ApplicationService) AddRedirectURI ¶
func (*ApplicationService) ByClientID ¶
func (a *ApplicationService) ByClientID( ctx context.Context, clientID string, ) (*ApplicationDTO, error)
func (*ApplicationService) CreateApplication ¶
func (*ApplicationService) List ¶
func (a *ApplicationService) List( ctx context.Context, page int, pageSize int, q string, sort string, ) (*PaginationResponse, error)
func (*ApplicationService) PurgeRetiredApplications ¶
func (a *ApplicationService) PurgeRetiredApplications(ctx context.Context) error
func (*ApplicationService) RemoveFlow ¶
func (a *ApplicationService) RemoveFlow( ctx context.Context, clientID string, flow application.FlowType, ) error
func (*ApplicationService) RemoveLogoutURI ¶
func (*ApplicationService) RemoveRedirectURI ¶
func (*ApplicationService) RetireApplication ¶
func (a *ApplicationService) RetireApplication(ctx context.Context, clientID string) error
func (*ApplicationService) TogglePKCE ¶
func (*ApplicationService) WithActiveUserAuthorizations ¶
func (a *ApplicationService) WithActiveUserAuthorizations( ctx context.Context, userID uuid.UUID, ) ([]*ApplicationDTO, error)
type AuthorizationDTO ¶
type AuthorizationDTO struct { ID uuid.UUID `json:"id"` User AuthorizationUserDTO `json:"user"` Application AuthorizationApplicationDTO `json:"application"` Properties map[string]interface{} `json:"properties"` RevokedAt *time.Time `json:"revoked_at"` CreatedAt time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"` }
type AuthorizationService ¶
type AuthorizationService struct {
// contains filtered or unexported fields
}
func NewAuthorizationService ¶
func NewAuthorizationService(store *db.DataStore, log *zap.Logger, cfg *config.Configuration, dispatcher *events.Dispatcher) *AuthorizationService
func (*AuthorizationService) ActiveByUser ¶
func (a *AuthorizationService) ActiveByUser( ctx context.Context, userID uuid.UUID, ) ([]*AuthorizationDTO, error)
func (*AuthorizationService) GrantAuthorization ¶
func (*AuthorizationService) List ¶
func (a *AuthorizationService) List( ctx context.Context, page int, pageSize int, q string, sort string, ) (*PaginationResponse, error)
func (*AuthorizationService) RevokeAuthorizationByClientIDAndUserID ¶
func (*AuthorizationService) RevokeAuthorizationClientIDAndEmail ¶
type AuthorizationUserDTO ¶
type InviteApplicationDTO ¶
type InviteDTO ¶
type InviteDTO struct { ID int `json:"id"` Email *string `json:"email"` Code string `json:"code"` SentAt *time.Time `json:"sent_at"` ConsumedAt *time.Time `json:"consumed_at"` ExpiresAt time.Time `json:"expires_at"` CreatedAt time.Time `json:"created_at"` Roles []string `json:"roles"` Applications []InviteApplicationDTO `json:"applications"` }
type InviteService ¶
type InviteService struct {
// contains filtered or unexported fields
}
InviteService is used to managed invitations
func NewInviteService ¶
func NewInviteService(store *db.DataStore, log *zap.Logger, dispatcher *events.Dispatcher) *InviteService
NewInviteService returns a new invite service
type PaginationResponse ¶
type PaginationResponse struct { Total int `json:"total"` Entries interface{} `json:"entries"` }
func (*PaginationResponse) Render ¶
func (*PaginationResponse) Render()
type RoleService ¶
type RoleService struct {
// contains filtered or unexported fields
}
func NewRoleService ¶
func NewRoleService(store *db.DataStore, log *zap.Logger, dispatcher *events.Dispatcher) *RoleService
func (*RoleService) CreateRole ¶
func (*RoleService) DeleteRole ¶
func (r *RoleService) DeleteRole(ctx context.Context, name string) error
type UserDTO ¶
type UserDTO struct { ID uuid.UUID `json:"id,omitempty"` Email string `json:"email"` EmailConfirmed *time.Time `json:"email_confirmed"` Phone *string `json:"phone"` PhoneConfirmed *time.Time `json:"phone_confirmed"` Mfa bool `json:"mfa"` LockoutTill *time.Time `json:"lockout_till"` BannedOn *time.Time `json:"banned_on"` CurrentFailureCount int `json:"current_failure_count"` RecoveryTokenCreated *time.Time `json:"recovery_token_created,omitempty"` ConfirmToken *string `json:"confirm_token"` ConfirmTokenCreated *time.Time `json:"confirm_token_created,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at,omitempty"` Roles []string `json:"roles"` }
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func NewUserService ¶
func NewUserService(store *db.DataStore, log *zap.Logger, cfg *config.Configuration, mailer *mailing.Mailer, dispatcher *events.Dispatcher) *UserService
func (*UserService) AddUserToRole ¶
func (*UserService) ConfirmUser ¶
func (*UserService) InitialUserInvite ¶
func (g *UserService) InitialUserInvite( ctx context.Context, inviteCode string, roles []string, appIds []int, ) error
InitialUserInvite used for docker container setup, it seeds a predefined a user invite for the admin user so the admin user can signup with his wanted credentials
func (*UserService) InsertUser ¶
func (*UserService) InviteUser ¶
func (g *UserService) InviteUser( ctx context.Context, email *string, roles []string, appIds []int, ) (generator.RandomTokenType, error)
func (*UserService) List ¶
func (g *UserService) List( ctx context.Context, page int, pageSize int, q string, sort string, ) (*PaginationResponse, error)
func (*UserService) RemoveUserFromRole ¶
func (*UserService) UnlockUser ¶
func (*UserService) VerifyUserInRole ¶
Click to show internal directories.
Click to hide internal directories.