facade

package
v0.0.0-...-c4f7e29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AuditLogFacade

type AuditLogFacade struct {
	AuditLogQuery         AuditLogQuery
	Clock                 clock.Clock
	AuditDatabase         *auditdb.ReadHandle
	AuditLogFeatureConfig *config.AuditLogFeatureConfig
}

func (*AuditLogFacade) QueryPage

type AuditLogQuery

type AuditLogQuery interface {
	Count(opts audit.QueryPageOptions) (uint64, error)
	QueryPage(opts audit.QueryPageOptions, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
}

type AuthenticatorFacade

type AuthenticatorFacade struct {
	Authenticators AuthenticatorService
	Interaction    InteractionService
}

func (*AuthenticatorFacade) Get

func (*AuthenticatorFacade) List

func (f *AuthenticatorFacade) List(userID string, authenticatorType *apimodel.AuthenticatorType, authenticatorKind *authenticator.Kind) ([]*authenticator.Ref, error)

func (*AuthenticatorFacade) Remove

func (f *AuthenticatorFacade) Remove(authenticatorInfo *authenticator.Info) error

type AuthenticatorService

type AuthenticatorService interface {
	Get(id string) (*authenticator.Info, error)
	Count(userID string) (uint64, error)
	ListRefsByUsers(userIDs []string, authenticatorType *apimodel.AuthenticatorType, authenticatorKind *authenticator.Kind) ([]*authenticator.Ref, error)
}

type AuthorizationFacade

type AuthorizationFacade struct {
	Authorizations AuthorizationService
}

func (*AuthorizationFacade) Delete

func (*AuthorizationFacade) Get

func (*AuthorizationFacade) List

func (f *AuthorizationFacade) List(userID string, filters ...oauth.AuthorizationFilter) ([]*oauth.Authorization, error)

type AuthorizationService

type AuthorizationService interface {
	GetByID(id string) (*oauth.Authorization, error)
	ListByUser(userID string, filters ...oauth.AuthorizationFilter) ([]*oauth.Authorization, error)
	Delete(a *oauth.Authorization) error
}

type CustomAttributesService

type CustomAttributesService interface {
	ReadCustomAttributesInStorageForm(role accesscontrol.Role, userID string, storageForm map[string]interface{}) (map[string]interface{}, error)
	UpdateAllCustomAttributes(role accesscontrol.Role, userID string, customAttrs map[string]interface{}) error
}

type EventService

type EventService interface {
	DispatchEventOnCommit(payload event.Payload) error
}

type IdentityFacade

type IdentityFacade struct {
	Identities  IdentityService
	Interaction InteractionService
}

func (*IdentityFacade) Create

func (f *IdentityFacade) Create(userID string, identityDef model.IdentityDef, password string) (*apimodel.IdentityRef, error)

func (*IdentityFacade) Get

func (f *IdentityFacade) Get(id string) (*identity.Info, error)

func (*IdentityFacade) List

func (f *IdentityFacade) List(userID string, identityType *apimodel.IdentityType) ([]*apimodel.IdentityRef, error)

func (*IdentityFacade) Remove

func (f *IdentityFacade) Remove(identityInfo *identity.Info) error

func (*IdentityFacade) Update

func (f *IdentityFacade) Update(identityID string, userID string, identityDef model.IdentityDef) (*apimodel.IdentityRef, error)

type IdentityService

type IdentityService interface {
	Get(id string) (*identity.Info, error)
	ListRefsByUsers(userIDs []string, identityType *apimodel.IdentityType) ([]*apimodel.IdentityRef, error)
}

type InteractionService

type InteractionService interface {
	Perform(intent interaction.Intent, input interface{}) (*interaction.Graph, error)
}

type OAuthAuthorizationService

type OAuthAuthorizationService interface {
	CheckAndGrant(
		clientID string,
		userID string,
		scopes []string,
	) (*oauth.Authorization, error)
}

type OAuthClientResolver

type OAuthClientResolver interface {
	ResolveClient(clientID string) *config.OAuthClientConfig
}

type OAuthFacade

type OAuthFacade struct {
	Config              *config.OAuthConfig
	Users               UserService
	Authorizations      OAuthAuthorizationService
	Tokens              OAuthTokenService
	Clock               clock.Clock
	OAuthClientResolver OAuthClientResolver
}

func (*OAuthFacade) CreateSession

func (f *OAuthFacade) CreateSession(clientID string, userID string) (session.Session, protocol.TokenResponse, error)

type OAuthTokenService

type OAuthTokenService interface {
	IssueOfflineGrant(
		client *config.OAuthClientConfig,
		opts handler.IssueOfflineGrantOptions,
		resp protocol.TokenResponse,
	) (*oauth.OfflineGrant, error)
	IssueAccessGrant(
		client *config.OAuthClientConfig,
		scopes []string,
		authzID string,
		userID string,
		sessionID string,
		sessionKind oauth.GrantSessionKind,
		resp protocol.TokenResponse,
	) error
}

type RolesGroupsCommands

type RolesGroupsCommands interface {
	CreateRole(options *rolesgroups.NewRoleOptions) (*model.Role, error)
	UpdateRole(options *rolesgroups.UpdateRoleOptions) (*model.Role, error)
	DeleteRole(id string) error

	CreateGroup(options *rolesgroups.NewGroupOptions) (*model.Group, error)
	UpdateGroup(options *rolesgroups.UpdateGroupOptions) (*model.Group, error)
	DeleteGroup(id string) error

	AddRoleToGroups(options *rolesgroups.AddRoleToGroupsOptions) (*model.Role, error)
	RemoveRoleFromGroups(options *rolesgroups.RemoveRoleFromGroupsOptions) (*model.Role, error)

	AddRoleToUsers(options *rolesgroups.AddRoleToUsersOptions) (*model.Role, error)
	RemoveRoleFromUsers(options *rolesgroups.RemoveRoleFromUsersOptions) (*model.Role, error)

	AddGroupToUsers(options *rolesgroups.AddGroupToUsersOptions) (*model.Group, error)
	RemoveGroupFromUsers(options *rolesgroups.RemoveGroupFromUsersOptions) (*model.Group, error)

	AddGroupToRoles(options *rolesgroups.AddGroupToRolesOptions) (*model.Group, error)
	RemoveGroupFromRoles(options *rolesgroups.RemoveGroupFromRolesOptions) (*model.Group, error)

	AddUserToRoles(options *rolesgroups.AddUserToRolesOptions) error
	RemoveUserFromRoles(options *rolesgroups.RemoveUserFromRolesOptions) error

	AddUserToGroups(options *rolesgroups.AddUserToGroupsOptions) error
	RemoveUserFromGroups(options *rolesgroups.RemoveUserFromGroupsOptions) error
}

type RolesGroupsFacade

type RolesGroupsFacade struct {
	RolesGroupsCommands RolesGroupsCommands
	RolesGroupsQueries  RolesGroupsQueries
}

func (*RolesGroupsFacade) AddGroupToRoles

func (f *RolesGroupsFacade) AddGroupToRoles(options *rolesgroups.AddGroupToRolesOptions) (groupID string, err error)

func (*RolesGroupsFacade) AddGroupToUsers

func (f *RolesGroupsFacade) AddGroupToUsers(options *rolesgroups.AddGroupToUsersOptions) (groupID string, err error)

func (*RolesGroupsFacade) AddRoleToGroups

func (f *RolesGroupsFacade) AddRoleToGroups(options *rolesgroups.AddRoleToGroupsOptions) (roleID string, err error)

func (*RolesGroupsFacade) AddRoleToUsers

func (f *RolesGroupsFacade) AddRoleToUsers(options *rolesgroups.AddRoleToUsersOptions) (roleID string, err error)

func (*RolesGroupsFacade) AddUserToGroups

func (f *RolesGroupsFacade) AddUserToGroups(options *rolesgroups.AddUserToGroupsOptions) (err error)

func (*RolesGroupsFacade) AddUserToRoles

func (f *RolesGroupsFacade) AddUserToRoles(options *rolesgroups.AddUserToRolesOptions) (err error)

func (*RolesGroupsFacade) CreateGroup

func (f *RolesGroupsFacade) CreateGroup(options *rolesgroups.NewGroupOptions) (groupID string, err error)

func (*RolesGroupsFacade) CreateRole

func (f *RolesGroupsFacade) CreateRole(options *rolesgroups.NewRoleOptions) (roleID string, err error)

func (*RolesGroupsFacade) DeleteGroup

func (f *RolesGroupsFacade) DeleteGroup(id string) (err error)

func (*RolesGroupsFacade) DeleteRole

func (f *RolesGroupsFacade) DeleteRole(id string) (err error)

func (*RolesGroupsFacade) GetGroup

func (f *RolesGroupsFacade) GetGroup(groupID string) (*model.Group, error)

func (*RolesGroupsFacade) GetRole

func (f *RolesGroupsFacade) GetRole(roleID string) (*model.Role, error)

func (*RolesGroupsFacade) ListAllGroupsByKeys

func (f *RolesGroupsFacade) ListAllGroupsByKeys(keys []string) ([]*model.Group, error)

func (*RolesGroupsFacade) ListAllRolesByKeys

func (f *RolesGroupsFacade) ListAllRolesByKeys(keys []string) ([]*model.Role, error)

func (*RolesGroupsFacade) ListAllUserIDsByEffectiveRoleIDs

func (f *RolesGroupsFacade) ListAllUserIDsByEffectiveRoleIDs(roleIDs []string) ([]string, error)

func (*RolesGroupsFacade) ListAllUserIDsByGroupIDs

func (f *RolesGroupsFacade) ListAllUserIDsByGroupIDs(groupIDs []string) ([]string, error)

func (*RolesGroupsFacade) ListAllUserIDsByGroupKeys

func (f *RolesGroupsFacade) ListAllUserIDsByGroupKeys(groupKeys []string) ([]string, error)

func (*RolesGroupsFacade) ListAllUserIDsByRoleIDs

func (f *RolesGroupsFacade) ListAllUserIDsByRoleIDs(roleIDs []string) ([]string, error)

func (*RolesGroupsFacade) ListEffectiveRolesByUserID

func (f *RolesGroupsFacade) ListEffectiveRolesByUserID(userID string) ([]*model.Role, error)

func (*RolesGroupsFacade) ListGroups

func (*RolesGroupsFacade) ListGroupsByRoleID

func (f *RolesGroupsFacade) ListGroupsByRoleID(roleID string) ([]*model.Group, error)

func (*RolesGroupsFacade) ListGroupsByUserID

func (f *RolesGroupsFacade) ListGroupsByUserID(userID string) ([]*model.Group, error)

func (*RolesGroupsFacade) ListRoles

func (*RolesGroupsFacade) ListRolesByGroupID

func (f *RolesGroupsFacade) ListRolesByGroupID(groupID string) ([]*model.Role, error)

func (*RolesGroupsFacade) ListRolesByUserID

func (f *RolesGroupsFacade) ListRolesByUserID(userID string) ([]*model.Role, error)

func (*RolesGroupsFacade) ListUserIDsByGroupID

func (f *RolesGroupsFacade) ListUserIDsByGroupID(groupID string, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, *graphqlutil.PageResult, error)

func (*RolesGroupsFacade) ListUserIDsByRoleID

func (f *RolesGroupsFacade) ListUserIDsByRoleID(roleID string, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, *graphqlutil.PageResult, error)

func (*RolesGroupsFacade) RemoveGroupFromRoles

func (f *RolesGroupsFacade) RemoveGroupFromRoles(options *rolesgroups.RemoveGroupFromRolesOptions) (groupID string, err error)

func (*RolesGroupsFacade) RemoveGroupFromUsers

func (f *RolesGroupsFacade) RemoveGroupFromUsers(options *rolesgroups.RemoveGroupFromUsersOptions) (groupID string, err error)

func (*RolesGroupsFacade) RemoveRoleFromGroups

func (f *RolesGroupsFacade) RemoveRoleFromGroups(options *rolesgroups.RemoveRoleFromGroupsOptions) (roleID string, err error)

func (*RolesGroupsFacade) RemoveRoleFromUsers

func (f *RolesGroupsFacade) RemoveRoleFromUsers(options *rolesgroups.RemoveRoleFromUsersOptions) (roleID string, err error)

func (*RolesGroupsFacade) RemoveUserFromGroups

func (f *RolesGroupsFacade) RemoveUserFromGroups(options *rolesgroups.RemoveUserFromGroupsOptions) (err error)

func (*RolesGroupsFacade) RemoveUserFromRoles

func (f *RolesGroupsFacade) RemoveUserFromRoles(options *rolesgroups.RemoveUserFromRolesOptions) (err error)

func (*RolesGroupsFacade) UpdateGroup

func (f *RolesGroupsFacade) UpdateGroup(options *rolesgroups.UpdateGroupOptions) (err error)

func (*RolesGroupsFacade) UpdateRole

func (f *RolesGroupsFacade) UpdateRole(options *rolesgroups.UpdateRoleOptions) (err error)

type RolesGroupsQueries

type RolesGroupsQueries interface {
	GetRole(id string) (*model.Role, error)
	GetGroup(id string) (*model.Group, error)
	ListRoles(options *rolesgroups.ListRolesOptions, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
	ListGroups(options *rolesgroups.ListGroupsOptions, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
	ListGroupsByRoleID(roleID string) ([]*model.Group, error)
	ListRolesByGroupID(groupID string) ([]*model.Role, error)
	ListRolesByUserID(userID string) ([]*model.Role, error)
	ListGroupsByUserID(userID string) ([]*model.Group, error)
	ListUserIDsByRoleID(roleID string, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
	ListUserIDsByGroupID(groupID string, pageArgs graphqlutil.PageArgs) ([]model.PageItemRef, error)
	ListEffectiveRolesByUserID(userID string) ([]*model.Role, error)
	ListAllUserIDsByGroupIDs(groupIDs []string) ([]string, error)
	ListAllUserIDsByGroupKeys(groupKeys []string) ([]string, error)
	ListAllUserIDsByRoleIDs(roleIDs []string) ([]string, error)
	ListAllUserIDsByEffectiveRoleIDs(roleIDs []string) ([]string, error)
	ListAllRolesByKeys(keys []string) ([]*model.Role, error)
	ListAllGroupsByKeys(keys []string) ([]*model.Group, error)
	CountRoles() (uint64, error)
	CountGroups() (uint64, error)
}

type SessionFacade

type SessionFacade struct {
	Sessions SessionManager
}

func (*SessionFacade) Get

func (f *SessionFacade) Get(id string) (session.Session, error)

func (*SessionFacade) List

func (f *SessionFacade) List(userID string) ([]session.Session, error)

func (*SessionFacade) Revoke

func (f *SessionFacade) Revoke(id string) error

func (*SessionFacade) RevokeAll

func (f *SessionFacade) RevokeAll(userID string) error

type SessionManager

type SessionManager interface {
	List(userID string) ([]session.Session, error)
	Get(id string) (session.Session, error)
	RevokeWithEvent(session session.Session, isTermination bool, isAdminAPI bool) error
	TerminateAllExcept(userID string, currentSession session.Session, isAdminAPI bool) error
}

type StandardAttributesService

type StandardAttributesService interface {
	UpdateStandardAttributes(role accesscontrol.Role, userID string, stdAttrs map[string]interface{}) error
	DeriveStandardAttributes(role accesscontrol.Role, userID string, updatedAt time.Time, attrs map[string]interface{}) (map[string]interface{}, error)
}

type UserFacade

type UserFacade struct {
	UserSearchService  UserSearchService
	Users              UserService
	StandardAttributes StandardAttributesService
	Interaction        InteractionService
}

func (*UserFacade) Anonymize

func (f *UserFacade) Anonymize(id string) (err error)

func (*UserFacade) Create

func (f *UserFacade) Create(identityDef model.IdentityDef, password string) (string, error)

func (*UserFacade) Delete

func (f *UserFacade) Delete(id string) error

func (*UserFacade) ListPage

func (*UserFacade) ResetPassword

func (f *UserFacade) ResetPassword(id string, password string) (err error)

func (*UserFacade) ScheduleAnonymization

func (f *UserFacade) ScheduleAnonymization(id string) (err error)

func (*UserFacade) ScheduleDeletion

func (f *UserFacade) ScheduleDeletion(id string) error

func (*UserFacade) SearchPage

func (f *UserFacade) SearchPage(
	searchKeyword string,
	filterOptions user.FilterOptions,
	sortOption user.SortOption,
	pageArgs graphqlutil.PageArgs) ([]apimodel.PageItemRef, *graphqlutil.PageResult, error)

func (*UserFacade) SetDisabled

func (f *UserFacade) SetDisabled(id string, isDisabled bool, reason *string) error

func (*UserFacade) UnscheduleAnonymization

func (f *UserFacade) UnscheduleAnonymization(id string) (err error)

func (*UserFacade) UnscheduleDeletion

func (f *UserFacade) UnscheduleDeletion(id string) error

type UserProfileFacade

type UserProfileFacade struct {
	User               UserService
	StandardAttributes StandardAttributesService
	CustomAttributes   CustomAttributesService
	Events             EventService
}

func (*UserProfileFacade) DeriveStandardAttributes

func (f *UserProfileFacade) DeriveStandardAttributes(role accesscontrol.Role, userID string, updatedAt time.Time, attrs map[string]interface{}) (map[string]interface{}, error)

func (*UserProfileFacade) ReadCustomAttributesInStorageForm

func (f *UserProfileFacade) ReadCustomAttributesInStorageForm(
	role accesscontrol.Role,
	userID string,
	storageForm map[string]interface{},
) (map[string]interface{}, error)

func (*UserProfileFacade) UpdateUserProfile

func (f *UserProfileFacade) UpdateUserProfile(
	role accesscontrol.Role,
	userID string,
	stdAttrs map[string]interface{},
	customAttrs map[string]interface{},
) (err error)

type UserSearchService

type UserSearchService interface {
	QueryUser(searchKeyword string,
		filterOptions user.FilterOptions,
		sortOption user.SortOption,
		pageArgs graphqlutil.PageArgs) ([]apimodel.PageItemRef, *libes.Stats, error)
}

type UserService

type UserService interface {
	GetRaw(id string) (*user.User, error)
	Count() (uint64, error)
	QueryPage(listOption user.ListOptions, pageArgs graphqlutil.PageArgs) ([]apimodel.PageItemRef, error)
	Delete(userID string) error
	Disable(userID string, reason *string) error
	Reenable(userID string) error
	ScheduleDeletionByAdmin(userID string) error
	UnscheduleDeletionByAdmin(userID string) error
	Anonymize(userID string) error
	ScheduleAnonymizationByAdmin(userID string) error
	UnscheduleAnonymizationByAdmin(userID string) error
	CheckUserAnonymized(userID string) error
}

type VerificationFacade

type VerificationFacade struct {
	Verification VerificationService
}

func (*VerificationFacade) Get

func (f *VerificationFacade) Get(userID string) ([]model.Claim, error)

func (*VerificationFacade) SetVerified

func (f *VerificationFacade) SetVerified(userID string, claimName string, claimValue string, isVerified bool) error

type VerificationService

type VerificationService interface {
	GetClaims(userID string) ([]*verification.Claim, error)
	NewVerifiedClaim(userID string, claimName string, claimValue string) *verification.Claim
	MarkClaimVerified(claim *verification.Claim) error
	DeleteClaim(claim *verification.Claim) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL