Documentation
¶
Index ¶
- Variables
- type AuthServicer
- type Organization
- func (service *Organization) Create(organization *entities.Organization) error
- func (service *Organization) Delete(session Session) error
- func (service *Organization) GetUsers(session Session) ([]*entities.User, error)
- func (service *Organization) Page(session Session, pageQuery datastore.PageQuery) (datastore.PageResult[*entities.Organization], error)
- type OrganizationService
- type Registration
- type RegistrationServicer
- type Registry
- type RoleService
- type RoleServicer
- type Service
- type ServiceSession
- func (session *ServiceSession) Close()
- func (session *ServiceSession) ConsistencyLevel() int
- func (session *ServiceSession) Error(err error)
- func (session *ServiceSession) IsMemberOfOrganization(organizationID uint64) bool
- func (session *ServiceSession) IsSystemSession() bool
- func (session *ServiceSession) Logger() *logging.Logger
- func (session *ServiceSession) RequestedOrganizationID() uint64
- func (session *ServiceSession) RequestedServiceID() uint64
- func (session *ServiceSession) String() string
- func (session *ServiceSession) User() *entities.User
- type Session
- type User
- type UserCredential
- type UserServicer
- type WebAuthnSessionService
- func (service *WebAuthnSessionService) Delete(session Session, sessionData *entities.Blob) error
- func (service *WebAuthnSessionService) Get(session Session, id uint64) (*entities.Blob, error)
- func (service *WebAuthnSessionService) Page(session Session, pageQuery datastore.PageQuery) (datastore.PageResult[*entities.Blob], error)
- func (service *WebAuthnSessionService) Save(sessionData *entities.Blob) error
- type WebAuthnSessionServicer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCreateService = errors.New("service: failed to create service") ErrPermissionDenied = errors.New("service: permission denied") ErrDeleteAdminAccount = errors.New("service: admin account can't be deleted") ErrChangeAdminRole = errors.New("service: admin role can't be changed") ErrResetPasswordUnsupported = errors.New("service: reset password feature unsupported by auth store") )
View Source
var ( ErrUnsupportedAuthType = errors.New("unsupported auth type") ErrUserNotFound = errors.New("user not found") )
View Source
var (
ErrOrganizationNotFound = errors.New("organization not found")
)
View Source
var (
ErrRegistrationNotFound = errors.New("registration not found")
)
View Source
var (
ErrRoleNotFound = errors.New("role not found")
)
View Source
var (
ErrWebAuthnNotFound = errors.New("service/webauthn: webauthn session data not found")
)
Functions ¶
This section is empty.
Types ¶
type AuthServicer ¶
type AuthServicer interface {
Activate(registrationID uint64) (*entities.User, error)
Login(userCredentials *UserCredential) (*entities.User, []*entities.Organization, []*entities.Service, error)
Register(userCredentials *UserCredential, baseURI string) (*entities.User, error)
ResetPassword(userCredentials *UserCredential) error
}
type Organization ¶
type Organization struct {
OrganizationService
// contains filtered or unexported fields
}
func (*Organization) Create ¶
func (service *Organization) Create(organization *entities.Organization) error
Creates a new organization
func (*Organization) Delete ¶
func (service *Organization) Delete(session Session) error
Deletes an existing organization and all associated entites from the database
func (*Organization) GetUsers ¶
func (service *Organization) GetUsers(session Session) ([]*entities.User, error)
Returns a list of User entities that belong to the organization
func (*Organization) Page ¶
func (service *Organization) Page(session Session, pageQuery datastore.PageQuery) (datastore.PageResult[*entities.Organization], error)
Returns a single page of organization entities
type OrganizationService ¶
type OrganizationService interface {
Create(organization *entities.Organization) error
Page(session Session, pageQuery datastore.PageQuery) (datastore.PageResult[*entities.Organization], error)
GetUsers(session Session) ([]*entities.User, error)
Delete(session Session) error
}
func NewOrganizationService ¶
func NewOrganizationService( logger *logging.Logger, orgDAO datastore.OrganizationDAO) OrganizationService
type Registration ¶
type Registration struct {
RegistrationServicer
// contains filtered or unexported fields
}
func (*Registration) Create ¶
func (service *Registration) Create(registration *entities.Registration) error
CreateRegistration creates a new registration account
func (*Registration) Delete ¶
func (service *Registration) Delete(session Session, registrationID uint64) error
Deletes an existing registration account
func (*Registration) Get ¶
func (service *Registration) Get(session Session, registrationID uint64) (*entities.Registration, error)
Looks up the registration account by registration ID
type RegistrationServicer ¶
type RegistrationServicer interface {
Create(registration *entities.Registration) error
Delete(session Session, registrationID uint64) error
Get(session Session, registrationID uint64) (*entities.Registration, error)
}
func NewRegistrationService ¶
func NewRegistrationService( logger *logging.Logger, registrationDAO datastore.RegistrationDAO) RegistrationServicer
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) RegistrationService ¶
func (registry *Registry) RegistrationService() RegistrationServicer
func (*Registry) UserService ¶
func (registry *Registry) UserService() UserServicer
func (*Registry) WebAuthnSessionService ¶
func (registry *Registry) WebAuthnSessionService() WebAuthnSessionServicer
type RoleService ¶
type RoleService struct {
RoleServicer
// contains filtered or unexported fields
}
func (*RoleService) Page ¶
func (service *RoleService) Page(pageQuery datastore.PageQuery) (datastore.PageResult[*entities.Role], error)
Returns a single page of role entities from the database
type RoleServicer ¶
type RoleServicer interface {
GetPage(pageQuery datastore.PageQuery) (datastore.PageResult[*entities.Role], error)
GetByName(name string, CONSISTENCY_LEVEL int) (*entities.Role, error)
}
func NewRoleService ¶
func NewRoleService( logger *logging.Logger, roleDAO datastore.RoleDAO) RoleServicer
type ServiceSession ¶
type ServiceSession struct {
Session
// contains filtered or unexported fields
}
func (*ServiceSession) Close ¶
func (session *ServiceSession) Close()
func (*ServiceSession) ConsistencyLevel ¶
func (session *ServiceSession) ConsistencyLevel() int
func (*ServiceSession) Error ¶
func (session *ServiceSession) Error(err error)
func (*ServiceSession) IsMemberOfOrganization ¶
func (session *ServiceSession) IsMemberOfOrganization(organizationID uint64) bool
func (*ServiceSession) IsSystemSession ¶
func (session *ServiceSession) IsSystemSession() bool
func (*ServiceSession) Logger ¶
func (session *ServiceSession) Logger() *logging.Logger
func (*ServiceSession) RequestedOrganizationID ¶
func (session *ServiceSession) RequestedOrganizationID() uint64
func (*ServiceSession) RequestedServiceID ¶
func (session *ServiceSession) RequestedServiceID() uint64
func (*ServiceSession) String ¶
func (session *ServiceSession) String() string
func (*ServiceSession) User ¶
func (session *ServiceSession) User() *entities.User
type Session ¶
type Session interface {
ConsistencyLevel() int
Close()
IsSystemSession() bool
Logger() *logging.Logger
RequestedOrganizationID() uint64
RequestedServiceID() uint64
SetLogger(*logging.Logger)
User() *entities.User
}
func CreateSession ¶
func NewSession ¶
func NewSession() Session
type User ¶
type User struct {
UserServicer
// contains filtered or unexported fields
}
type UserCredential ¶
type UserServicer ¶
type UserServicer interface {
Save(user *entities.User) error
Delete(session Session, userID uint64) error
Get(userID uint64) (*entities.User, error)
}
func NewUserService ¶
func NewUserService( logger *logging.Logger, userDAO datastore.UserDAO, orgDAO datastore.OrganizationDAO, roleDAO datastore.RoleDAO, authServices map[int]AuthServicer) UserServicer
type WebAuthnSessionService ¶
type WebAuthnSessionService struct {
WebAuthnSessionServicer
// contains filtered or unexported fields
}
func (*WebAuthnSessionService) Delete ¶
func (service *WebAuthnSessionService) Delete(session Session, sessionData *entities.Blob) error
type WebAuthnSessionServicer ¶
type WebAuthnSessionServicer interface {
Delete(session Session, sessionData *entities.Blob) error
Get(session Session, id uint64) (*entities.Blob, error)
Page(session Session, pageQuery datastore.PageQuery) (datastore.PageResult[*entities.Blob], error)
Save(sessionData *entities.Blob) error
}
func NewWebAuthnSessionService ¶
func NewWebAuthnSessionService( logger *logging.Logger, webAuthnDAO datastore.WebAuthnDAO) WebAuthnSessionServicer
Click to show internal directories.
Click to hide internal directories.