provision

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package provision creates tenants for Zitadel organizations on their first login (FA-TEN-03, ADR 0029).

Index

Constants

View Source
const (
	DefaultMax = 100
)

Defaults of the automatic provisioning (ADR 0029).

Variables

This section is empty.

Functions

This section is empty.

Types

type Applier

type Applier interface {
	Apply(ctx context.Context, cmd *pb.Command) (cluster.ApplyResult, error)
}

Applier proposes commands; *Node implements it.

type Provisioner

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

Provisioner creates the tenant of a Zitadel organization on its first login (FA-TEN-03, ADR 0029). The caller has verified the token and checked that the user holds a role in the organization. It implements oidc.Provisioner.

func NewProvisioner

func NewProvisioner(opts ProvisionerOptions) (*Provisioner, error)

NewProvisioner returns a provisioner. Max must be at least 1.

func (*Provisioner) Provision

func (p *Provisioner) Provision(ctx context.Context, orgID, orgName string) (string, error)

Provision implements oidc.Provisioner.

type ProvisionerOptions

type ProvisionerOptions struct {
	Cluster Applier
	// PlanID is the plan of new tenants (OIDC_AUTO_PROVISION_PLAN).
	PlanID string
	// Max is the highest number of automatically created tenants
	// (OIDC_AUTO_PROVISION_MAX); the FSM enforces it cluster-wide.
	Max int
	Log *slog.Logger
	// Now is replaced in tests.
	Now func() time.Time
}

ProvisionerOptions configure a Provisioner.

Jump to

Keyboard shortcuts

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