operator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkingStateTenantCreating            = "tenant is being created"
	WorkingStateTenantCreatedSuccessfully = "tenant created successfully"
	WorkingStateSchemaEncodingFailed      = "schema encoding failed"
	WorkingStateUnmarshallingFailed       = "failed to unmarshal data"
	WorkingStateSchemaCreationFailed      = "schema creation failed"
	WorkingStateGroupsCreationFailed      = "group creation failed"
	WorkingStateSendingGroupsFailed       = "failed to send groups to registry"
)

Variables

View Source
var (
	ErrCheckingTenantExistence = errors.New("checking tenant existence failed")
	ErrUninitializedDatabase   = errors.New("database connection not initialized")
	ErrGroupNotFound           = errors.New("group not found")
	ErrSchemaNotFound          = errors.New("schema not found")
	ErrSendingGroupsFailed     = errors.New("sending groups failed")

	ErrMissingProperties = errors.New("missing required properties in auth request")
	ErrMissingIssuer     = errors.New("missing required issuer property")
	ErrMissingTenantID   = errors.New("missing required tenant ID property")
)
View Source
var (
	ErrInvalidData       = errors.New("invalid data")
	ErrFailedResponse    = errors.New("failed response")
	ErrTenantOffboarding = errors.New("tenant offboarding error")

	ErrInvalidTenantID  = errors.New("invalid tenant ID")
	ErrInvalidAuthProps = errors.New("invalid authentication properties")
	ErrFailedApplyOIDC  = errors.New("failed apply OIDC")
)

Functions

func WithMTLS

func WithMTLS(mtls commoncfg.MTLS) amqp.ClientOption

Types

type GroupsExistenceStatus

type GroupsExistenceStatus int
const (
	// GroupsNotFound indicates that one or more required groups don't exist yet or are still being created
	GroupsNotFound GroupsExistenceStatus = iota + 1
	// GroupsExist indicates that all required groups exist
	GroupsExist
	// GroupsCheckFailed indicates that there was an error checking for group existence
	GroupsCheckFailed
)

type OIDCConfig

type OIDCConfig struct {
	Issuer               string
	JwksURI              string
	Audiences            []string
	AdditionalProperties map[string]string
}

OIDCConfig extracted from auth properties

type SchemaExistenceStatus

type SchemaExistenceStatus int
const (
	// SchemaNotFound indicates that the schema doesn't exist yet or is still being created
	SchemaNotFound SchemaExistenceStatus = iota + 1
	// SchemaExists indicates that the schema exists in the database
	SchemaExists
	// SchemaCheckFailed indicates that there was an error checking for schema existence
	SchemaCheckFailed
)

type TenantOperator

type TenantOperator struct {
	// contains filtered or unexported fields
}

func NewTenantOperator

func NewTenantOperator(
	db *multitenancy.DB,
	operatorTarget orbital.OperatorTarget,
	clientsFactory clients.Factory,
	tenantManager manager.Tenant,
	groupManager *manager.GroupManager,
) (*TenantOperator, error)

func (*TenantOperator) RunOperator

func (o *TenantOperator) RunOperator(ctx context.Context) error

RunOperator initializes the Orbital operator, registers all task handlers, and starts the listener. It returns a channel that is closed when the listener goroutine exits, or an error if initialization fails.

type TenantProbe

type TenantProbe struct {
	MultitenancyDB *multitenancy.DB
	Repo           repo.Repo
}

TenantProbe checks for the existence of tenant resources.

func (*TenantProbe) Check

func (p *TenantProbe) Check(ctx context.Context, tenant *model.Tenant) (TenantProbeResult, error)

Check verifies the existence of tenant schema and groups for the provided tenant. It returns a TenantProbeResult with the current status of schema and group existence, along with any error that occurred during the check.

type TenantProbeResult

type TenantProbeResult struct {
	SchemaStatus SchemaExistenceStatus
	GroupsStatus GroupsExistenceStatus
}

TenantProbeResult holds the statuses of the tenant schema and group existence checks.

Jump to

Keyboard shortcuts

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