commands

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminRoleName       = "admin"
	SystemAdminRoleName = "system-admin"

	AdminApplicationName = "admin-ui"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignRoleToUser

type AssignRoleToUser struct {
	VirtualServerName string
	ProjectSlug       string
	UserId            uuid.UUID
	RoleId            uuid.UUID
}

func (AssignRoleToUser) GetRequestName

func (a AssignRoleToUser) GetRequestName() string

func (AssignRoleToUser) IsAllowed

func (AssignRoleToUser) LogRequest

func (a AssignRoleToUser) LogRequest() bool

func (AssignRoleToUser) LogResponse

func (a AssignRoleToUser) LogResponse() bool

type AssignRoleToUserResponse

type AssignRoleToUserResponse struct{}

func HandleAssignRoleToUser

func HandleAssignRoleToUser(ctx context.Context, command AssignRoleToUser) (*AssignRoleToUserResponse, error)

type AssociateServiceUserPublicKey

type AssociateServiceUserPublicKey struct {
	Kid               *string
	VirtualServerName string
	ServiceUserId     uuid.UUID
	PublicKey         string
}

func (AssociateServiceUserPublicKey) GetRequestName

func (a AssociateServiceUserPublicKey) GetRequestName() string

func (AssociateServiceUserPublicKey) IsAllowed

func (AssociateServiceUserPublicKey) LogRequest

func (a AssociateServiceUserPublicKey) LogRequest() bool

func (AssociateServiceUserPublicKey) LogResponse

func (a AssociateServiceUserPublicKey) LogResponse() bool

type AssociateServiceUserPublicKeyResponse

type AssociateServiceUserPublicKeyResponse struct {
	Id  uuid.UUID
	Kid string
}

type CreateApplication

type CreateApplication struct {
	VirtualServerName      string
	ProjectSlug            string
	Name                   string
	DisplayName            string
	Type                   repositories.ApplicationType
	RedirectUris           []string
	PostLogoutRedirectUris []string

	HashedSecret          *string
	AccessTokenHeaderType string
	DeviceFlowEnabled     bool
}

func (CreateApplication) GetRequestName

func (c CreateApplication) GetRequestName() string

func (CreateApplication) IsAllowed

func (CreateApplication) LogRequest

func (c CreateApplication) LogRequest() bool

func (CreateApplication) LogResponse

func (c CreateApplication) LogResponse() bool

type CreateApplicationResponse

type CreateApplicationResponse struct {
	Id     uuid.UUID
	Secret *string
}

func HandleCreateApplication

func HandleCreateApplication(ctx context.Context, command CreateApplication) (*CreateApplicationResponse, error)

type CreatePasswordRule

type CreatePasswordRule struct {
	VirtualServerName string
	Type              repositories.PasswordRuleType
	Details           map[string]interface{}
}

func (CreatePasswordRule) GetRequestName

func (a CreatePasswordRule) GetRequestName() string

func (CreatePasswordRule) IsAllowed

func (CreatePasswordRule) LogRequest

func (a CreatePasswordRule) LogRequest() bool

func (CreatePasswordRule) LogResponse

func (a CreatePasswordRule) LogResponse() bool

type CreatePasswordRuleResponse

type CreatePasswordRuleResponse struct{}

func HandleCreatePasswordRule

func HandleCreatePasswordRule(ctx context.Context, command CreatePasswordRule) (*CreatePasswordRuleResponse, error)

type CreateProject

type CreateProject struct {
	VirtualServerName string
	Slug              string
	Name              string
	Description       string
}

func (CreateProject) GetRequestName

func (a CreateProject) GetRequestName() string

func (CreateProject) IsAllowed

func (CreateProject) LogRequest

func (a CreateProject) LogRequest() bool

func (CreateProject) LogResponse

func (a CreateProject) LogResponse() bool

type CreateProjectResponse

type CreateProjectResponse struct {
	Id uuid.UUID
}

func HandleCreateProject

func HandleCreateProject(ctx context.Context, command CreateProject) (*CreateProjectResponse, error)

type CreateResourceServer

type CreateResourceServer struct {
	VirtualServerName string
	ProjectSlug       string
	Slug              string
	Name              string
	Description       string
}

func (CreateResourceServer) GetRequestName

func (a CreateResourceServer) GetRequestName() string

func (CreateResourceServer) IsAllowed

func (CreateResourceServer) LogRequest

func (a CreateResourceServer) LogRequest() bool

func (CreateResourceServer) LogResponse

func (a CreateResourceServer) LogResponse() bool

type CreateResourceServerResponse

type CreateResourceServerResponse struct {
	Id uuid.UUID
}

type CreateResourceServerScope

type CreateResourceServerScope struct {
	VirtualServerName string
	ProjectSlug       string
	ResourceServerId  uuid.UUID
	Scope             string
	Name              string
	Description       string
}

func (CreateResourceServerScope) IsAllowed

func (CreateResourceServerScope) LogRequest

func (a CreateResourceServerScope) LogRequest() bool

func (CreateResourceServerScope) LogResponse

func (a CreateResourceServerScope) LogResponse() bool

type CreateResourceServerScopeResponse

type CreateResourceServerScopeResponse struct {
	Id uuid.UUID
}

type CreateRole

type CreateRole struct {
	VirtualServerName string
	ProjectSlug       string
	Name              string
	Description       string
}

func (CreateRole) GetRequestName

func (a CreateRole) GetRequestName() string

func (CreateRole) IsAllowed

func (a CreateRole) IsAllowed(ctx context.Context) (behaviours.PolicyResult, error)

func (CreateRole) LogRequest

func (a CreateRole) LogRequest() bool

func (CreateRole) LogResponse

func (a CreateRole) LogResponse() bool

type CreateRoleResponse

type CreateRoleResponse struct {
	Id uuid.UUID
}

func HandleCreateRole

func HandleCreateRole(ctx context.Context, command CreateRole) (*CreateRoleResponse, error)

type CreateServiceUser

type CreateServiceUser struct {
	VirtualServerName string
	Username          string
}

func (CreateServiceUser) GetRequestName

func (a CreateServiceUser) GetRequestName() string

func (CreateServiceUser) IsAllowed

func (CreateServiceUser) LogRequest

func (a CreateServiceUser) LogRequest() bool

func (CreateServiceUser) LogResponse

func (a CreateServiceUser) LogResponse() bool

type CreateServiceUserResponse

type CreateServiceUserResponse struct {
	Id uuid.UUID
}

func HandleCreateServiceUser

func HandleCreateServiceUser(ctx context.Context, command CreateServiceUser) (*CreateServiceUserResponse, error)

type CreateUser

type CreateUser struct {
	VirtualServerName string
	Username          string
	DisplayName       string
	Email             string
	EmailVerified     bool
}

func (CreateUser) GetRequestName

func (a CreateUser) GetRequestName() string

func (CreateUser) IsAllowed

func (a CreateUser) IsAllowed(ctx context.Context) (behaviours.PolicyResult, error)

func (CreateUser) LogRequest

func (a CreateUser) LogRequest() bool

func (CreateUser) LogResponse

func (a CreateUser) LogResponse() bool

type CreateUserResponse

type CreateUserResponse struct {
	Id uuid.UUID
}

func HandleCreateUser

func HandleCreateUser(ctx context.Context, command CreateUser) (*CreateUserResponse, error)

type CreateVirtualServer

type CreateVirtualServer struct {
	Name               string
	DisplayName        string
	EnableRegistration bool
	SigningAlgorithm   config.SigningAlgorithm
	Require2fa         bool

	CreateSystemAdminRole bool

	Admin        *CreateVirtualServerAdmin
	ServiceUsers []CreateVirtualServerServiceUser
	Projects     []CreateVirtualServerProject
}

func (CreateVirtualServer) GetRequestName

func (a CreateVirtualServer) GetRequestName() string

func (CreateVirtualServer) IsAllowed

func (CreateVirtualServer) LogRequest

func (a CreateVirtualServer) LogRequest() bool

func (CreateVirtualServer) LogResponse

func (a CreateVirtualServer) LogResponse() bool

type CreateVirtualServerAdmin

type CreateVirtualServerAdmin struct {
	Username     string
	DisplayName  string
	PrimaryEmail string
	PasswordHash string
	Roles        []string
}

type CreateVirtualServerProject

type CreateVirtualServerProject struct {
	Slug        string
	Name        string
	Description string

	Applications    []CreateVirtualServerProjectApplication
	Roles           []CreateVirtualServerProjectRole
	ResourceServers []CreateVirtualServerProjectResourceServer
}

type CreateVirtualServerProjectApplication

type CreateVirtualServerProjectApplication struct {
	Name              string
	DisplayName       string
	Type              string
	HashedSecret      *string
	RedirectUris      []string
	PostLogoutUris    []string
	DeviceFlowEnabled bool
}

type CreateVirtualServerProjectResourceServer

type CreateVirtualServerProjectResourceServer struct {
	Slug        string
	Name        string
	Description string
}

type CreateVirtualServerProjectRole

type CreateVirtualServerProjectRole struct {
	Name        string
	Description string
}

type CreateVirtualServerResponse

type CreateVirtualServerResponse struct {
	Id                   uuid.UUID
	SystemProjectId      uuid.UUID
	SystemProjectSlug    string
	AdminUiApplicationId uuid.UUID
	AdminRoleId          uuid.UUID
}

func HandleCreateVirtualServer

func HandleCreateVirtualServer(ctx context.Context, command CreateVirtualServer) (*CreateVirtualServerResponse, error)

type CreateVirtualServerServiceUser

type CreateVirtualServerServiceUser struct {
	Username  string
	Roles     []string
	PublicKey struct {
		Pem string
		Kid string
	}
}

type DeleteApplication

type DeleteApplication struct {
	VirtualServerName string
	ProjectSlug       string
	ApplicationId     uuid.UUID
}

func (DeleteApplication) GetRequestName

func (a DeleteApplication) GetRequestName() string

func (DeleteApplication) IsAllowed

func (DeleteApplication) LogRequest

func (a DeleteApplication) LogRequest() bool

func (DeleteApplication) LogResponse

func (a DeleteApplication) LogResponse() bool

type DeleteApplicationResponse

type DeleteApplicationResponse struct{}

func HandleDeleteApplication

func HandleDeleteApplication(ctx context.Context, command DeleteApplication) (*DeleteApplicationResponse, error)

type DeleteRole added in v0.3.10

type DeleteRole struct {
	VirtualServerName string
	ProjectSlug       string
	RoleId            uuid.UUID
}

func (DeleteRole) GetRequestName added in v0.3.10

func (a DeleteRole) GetRequestName() string

func (DeleteRole) IsAllowed added in v0.3.10

func (a DeleteRole) IsAllowed(ctx context.Context) (behaviours.PolicyResult, error)

func (DeleteRole) LogRequest added in v0.3.10

func (a DeleteRole) LogRequest() bool

func (DeleteRole) LogResponse added in v0.3.10

func (a DeleteRole) LogResponse() bool

type DeleteRoleResponse added in v0.3.10

type DeleteRoleResponse struct{}

func HandleDeleteRole added in v0.3.10

func HandleDeleteRole(ctx context.Context, command DeleteRole) (*DeleteRoleResponse, error)

type PatchApplication

type PatchApplication struct {
	VirtualServerName     string
	ProjectSlug           string
	ApplicationId         uuid.UUID
	DisplayName           *string
	ClaimsMappingScript   *string
	AccessTokenHeaderType *string
	DeviceFlowEnabled     *bool
}

func (PatchApplication) GetRequestName

func (a PatchApplication) GetRequestName() string

func (PatchApplication) IsAllowed

func (PatchApplication) LogRequest

func (a PatchApplication) LogRequest() bool

func (PatchApplication) LogResponse

func (a PatchApplication) LogResponse() bool

type PatchApplicationResponse

type PatchApplicationResponse struct{}

func HandlePatchApplication

func HandlePatchApplication(ctx context.Context, command PatchApplication) (*PatchApplicationResponse, error)

type PatchProject

type PatchProject struct {
	VirtualServerName string
	Slug              string
	Name              *string
	Description       *string
}

func (PatchProject) GetRequestName

func (a PatchProject) GetRequestName() string

func (PatchProject) IsAllowed

func (PatchProject) LogRequest

func (a PatchProject) LogRequest() bool

func (PatchProject) LogResponse

func (a PatchProject) LogResponse() bool

type PatchProjectResponse

type PatchProjectResponse struct{}

func HandlePatchProject

func HandlePatchProject(ctx context.Context, command PatchProject) (*PatchProjectResponse, error)

type PatchResourceServer

type PatchResourceServer struct {
	VirtualServerName string
	ProjectSlug       string
	ResourceServerId  uuid.UUID
	Name              *string
	Description       *string
}

func (PatchResourceServer) GetRequestName

func (a PatchResourceServer) GetRequestName() string

func (PatchResourceServer) IsAllowed

func (PatchResourceServer) LogRequest

func (a PatchResourceServer) LogRequest() bool

func (PatchResourceServer) LogResponse

func (a PatchResourceServer) LogResponse() bool

type PatchResourceServerResponse

type PatchResourceServerResponse struct{}

func HandlePatchResourceServer

func HandlePatchResourceServer(ctx context.Context, command PatchResourceServer) (*PatchResourceServerResponse, error)

type PatchRole

type PatchRole struct {
	VirtualServerName string
	ProjectSlug       string
	RoleId            uuid.UUID
	Name              *string
	Description       *string
}

func (PatchRole) GetRequestName

func (a PatchRole) GetRequestName() string

func (PatchRole) IsAllowed

func (a PatchRole) IsAllowed(ctx context.Context) (behaviours.PolicyResult, error)

func (PatchRole) LogRequest

func (a PatchRole) LogRequest() bool

func (PatchRole) LogResponse

func (a PatchRole) LogResponse() bool

type PatchRoleResponse

type PatchRoleResponse struct{}

func HandlePatchRole

func HandlePatchRole(ctx context.Context, command PatchRole) (*PatchRoleResponse, error)

type PatchUser

type PatchUser struct {
	VirtualServerName string
	UserId            uuid.UUID
	DisplayName       *string
	EmailVerified     *bool
}

func (PatchUser) GetRequestName

func (a PatchUser) GetRequestName() string

func (PatchUser) IsAllowed

func (a PatchUser) IsAllowed(ctx context.Context) (behaviours.PolicyResult, error)

func (PatchUser) LogRequest

func (a PatchUser) LogRequest() bool

func (PatchUser) LogResponse

func (a PatchUser) LogResponse() bool

type PatchUserAppMetadata

type PatchUserAppMetadata struct {
	VirtualServerName string
	UserId            uuid.UUID
	ApplicationId     uuid.UUID
	Metadata          map[string]any
}

func (PatchUserAppMetadata) GetRequestName

func (a PatchUserAppMetadata) GetRequestName() string

func (PatchUserAppMetadata) IsAllowed

func (PatchUserAppMetadata) LogRequest

func (a PatchUserAppMetadata) LogRequest() bool

func (PatchUserAppMetadata) LogResponse

func (a PatchUserAppMetadata) LogResponse() bool

type PatchUserAppMetadataResponse

type PatchUserAppMetadataResponse struct{}

type PatchUserMetadata

type PatchUserMetadata struct {
	VirtualServerName string
	UserId            uuid.UUID
	Metadata          map[string]any
}

func (PatchUserMetadata) GetRequestName

func (a PatchUserMetadata) GetRequestName() string

func (PatchUserMetadata) IsAllowed

func (PatchUserMetadata) LogRequest

func (a PatchUserMetadata) LogRequest() bool

func (PatchUserMetadata) LogResponse

func (a PatchUserMetadata) LogResponse() bool

type PatchUserMetadataResponse

type PatchUserMetadataResponse struct{}

func HandlePatchUserMetadata

func HandlePatchUserMetadata(ctx context.Context, command PatchUserMetadata) (*PatchUserMetadataResponse, error)

type PatchUserResponse

type PatchUserResponse struct{}

func HandlePatchUser

func HandlePatchUser(ctx context.Context, command PatchUser) (*PatchUserResponse, error)

type PatchVirtualServer

type PatchVirtualServer struct {
	VirtualServerName string
	DisplayName       *string

	EnableRegistration       *bool
	Require2fa               *bool
	RequireEmailVerification *bool
}

func (PatchVirtualServer) GetRequestName

func (a PatchVirtualServer) GetRequestName() string

func (PatchVirtualServer) IsAllowed

func (PatchVirtualServer) LogRequest

func (a PatchVirtualServer) LogRequest() bool

func (PatchVirtualServer) LogResponse

func (a PatchVirtualServer) LogResponse() bool

type PatchVirtualServerResponse

type PatchVirtualServerResponse struct{}

func HandlePatchVirtualServer

func HandlePatchVirtualServer(ctx context.Context, command PatchVirtualServer) (*PatchVirtualServerResponse, error)

type RegisterUser

type RegisterUser struct {
	VirtualServerName string
	DisplayName       string
	Username          string
	Password          string
	Email             string
}

type RegisterUserResponse

type RegisterUserResponse struct {
	Id uuid.UUID
}

func HandleRegisterUser

func HandleRegisterUser(ctx context.Context, command RegisterUser) (*RegisterUserResponse, error)

type RemoveServiceUserPublicKey

type RemoveServiceUserPublicKey struct {
	VirtualServerName string
	ServiceUserId     uuid.UUID
	PublicKey         string
}

func (RemoveServiceUserPublicKey) GetRequestName

func (a RemoveServiceUserPublicKey) GetRequestName() string

func (RemoveServiceUserPublicKey) IsAllowed

func (RemoveServiceUserPublicKey) LogRequest

func (a RemoveServiceUserPublicKey) LogRequest() bool

func (RemoveServiceUserPublicKey) LogResponse

func (a RemoveServiceUserPublicKey) LogResponse() bool

type RemoveServiceUserPublicKeyResponse

type RemoveServiceUserPublicKeyResponse struct{}

type SetPassword

type SetPassword struct {
	UserId      uuid.UUID
	NewPassword string
	Temporary   bool
}

func (SetPassword) GetRequestName

func (a SetPassword) GetRequestName() string

func (SetPassword) IsAllowed

func (SetPassword) LogRequest

func (a SetPassword) LogRequest() bool

func (SetPassword) LogResponse

func (a SetPassword) LogResponse() bool

type SetPasswordResponse

type SetPasswordResponse struct{}

func HandleSetPassword

func HandleSetPassword(ctx context.Context, command SetPassword) (*SetPasswordResponse, error)

type UpdatePasswordRule

type UpdatePasswordRule struct {
	VirtualServerName string
	Type              repositories.PasswordRuleType
	Details           map[string]interface{}
}

type UpdatePasswordRuleResponse

type UpdatePasswordRuleResponse struct{}

func HandleUpdatePasswordRule

func HandleUpdatePasswordRule(ctx context.Context, command UpdatePasswordRule) (*UpdatePasswordRuleResponse, error)

type UpdateUserAppMetadata

type UpdateUserAppMetadata struct {
	VirtualServerName string
	UserId            uuid.UUID
	ApplicationId     uuid.UUID
	Metadata          map[string]any
}

func (UpdateUserAppMetadata) GetRequestName

func (a UpdateUserAppMetadata) GetRequestName() string

func (UpdateUserAppMetadata) IsAllowed

func (UpdateUserAppMetadata) LogRequest

func (a UpdateUserAppMetadata) LogRequest() bool

func (UpdateUserAppMetadata) LogResponse

func (a UpdateUserAppMetadata) LogResponse() bool

type UpdateUserAppMetadataResponse

type UpdateUserAppMetadataResponse struct{}

type UpdateUserMetadata

type UpdateUserMetadata struct {
	VirtualServerName string
	UserId            uuid.UUID
	Metadata          map[string]any
}

func (UpdateUserMetadata) GetRequestName

func (a UpdateUserMetadata) GetRequestName() string

func (UpdateUserMetadata) IsAllowed

func (UpdateUserMetadata) LogRequest

func (a UpdateUserMetadata) LogRequest() bool

func (UpdateUserMetadata) LogResponse

func (a UpdateUserMetadata) LogResponse() bool

type UpdateUserMetadataResponse

type UpdateUserMetadataResponse struct{}

func HandleUpdateUserMetadata

func HandleUpdateUserMetadata(ctx context.Context, command UpdateUserMetadata) (*UpdateUserMetadataResponse, error)

type VerifyEmail

type VerifyEmail struct {
	VirtualServerName string
	Token             string
}

func (VerifyEmail) GetRequestName

func (a VerifyEmail) GetRequestName() string

type VerifyEmailResponse

type VerifyEmailResponse struct {
}

func HandleVerifyEmail

func HandleVerifyEmail(ctx context.Context, command VerifyEmail) (*VerifyEmailResponse, error)

Jump to

Keyboard shortcuts

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