Help us shape the future of Go! Take the 2026 Go Developer Survey

authority

package
v0.1.0-rc.41 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: BSD-3-Clause Imports: 33 Imported by: 0

Documentation

Overview

Package authorityapi serves the built-in authority HTTP API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(cfg Config, store Store) (*http.ServeMux, error)

NewHandler constructs a standalone HTTP handler for the built-in authority API.

Types

type Config

type Config struct {
	ControlURL           string
	OIDCIssuer           string
	OIDCClientID         string
	OIDCClientSecret     string
	OIDCScopes           []string
	HTTPClient           *http.Client
	OIDCVerifier         oidc.Verifier
	WebServiceSecret     string
	ManagedDomain        string
	AccessTokenLifetime  time.Duration
	RefreshTokenLifetime time.Duration
	DNSAutomation        bool
	CustomDomainsEnabled bool
	EmailDelivery        bool
}

Config contains settings for the built-in authority API.

type PublisherIdentityStore

type PublisherIdentityStore interface {
	RedeemPublisherEnrollment(context.Context, string, ed25519.PublicKey, time.Time) (controlstate.PublisherIdentity, error)
	ExchangePublisherAssertion(context.Context, string, string, string, string, string, time.Time) (controlstate.PublisherAccess, error)
	RotatePublisherKey(context.Context, string, string, string, string, ed25519.PublicKey, string, string, time.Time) error
}

type Routes

type Routes map[string]struct{}

Routes contains the patterns registered by the built-in authority API.

func Register

func Register(mux *http.ServeMux, cfg Config, store Store) (Routes, error)

Register adds the built-in authority API routes to mux and returns their patterns.

func (Routes) Matches

func (routes Routes) Matches(pattern string) bool

Matches reports whether the authority registered this router pattern.

type Store

type Store interface {
	AuthorizeTeamSession(context.Context, controlstate.ControlPrincipal, string, time.Time) error
	EnsureServiceIdentity(context.Context, string, controlstate.OIDCIdentity, time.Time) (controlstate.IdentityContext, error)
	PreviewInvitation(context.Context, string, string, time.Time) (controlstate.InvitationPreview, error)
	CreateOIDCControlSession(context.Context, string, controlstate.OIDCIdentity, time.Duration, time.Duration, time.Time) (controlstate.ControlSession, error)
	RefreshControlSession(context.Context, credentials.RefreshToken, time.Duration, time.Time) (controlstate.ControlSession, error)
	RevokeControlSession(context.Context, controlstate.ControlPrincipal, time.Time) error
	AuthenticateAccessToken(context.Context, credentials.AccessToken, time.Time) (controlstate.ControlPrincipal, error)
	IdentityContext(context.Context, string) (controlstate.IdentityContext, error)
	ListTeams(context.Context, string) ([]controlstate.Team, error)
	CreateTeam(context.Context, controlstate.CreateTeamRequest, time.Time) (controlstate.Team, error)
	GetTeam(context.Context, string, string) (controlstate.Team, error)
	ListTeamMemberships(context.Context, string, string) ([]controlstate.Membership, error)
	SetMembershipRole(context.Context, string, string, string, controlstate.TeamRole, time.Time) (controlstate.Membership, error)
	RemoveMembership(context.Context, string, string, string, time.Time) error
	ListTeamInvitations(context.Context, string, string, time.Time) ([]controlstate.Invitation, error)
	CreateTeamInvitation(context.Context, controlstate.CreateInvitationRequest, time.Time) (controlstate.InvitationSecret, error)
	RevokeTeamInvitation(context.Context, string, string, string, time.Time) error
	AcceptInvitation(context.Context, string, credentials.InvitationToken, time.Time) (controlstate.Membership, error)
	ListTeamDomains(context.Context, string, string) ([]controlstate.Domain, error)
	ClaimTeamDomain(context.Context, controlstate.ClaimDomainRequest, time.Time) (controlstate.Domain, error)
	SetTeamDefaultDomain(context.Context, string, string, string, time.Time) (controlstate.Team, error)
	ReleaseTeamDomain(context.Context, string, string, string, time.Time) error
}

Store is the stored state used by the built-in authority API.

Jump to

Keyboard shortcuts

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