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 ¶
NewHandler constructs a standalone HTTP handler for the built-in authority API.
func PublisherEnrollmentResponse ¶
func PublisherEnrollmentResponse(p controlstate.PublisherIdentity) authorityv1.PublisherEnrollmentResult
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
DelegationSetID string
NameserverDomain string
EmailDelivery bool
}
Config contains settings for the built-in authority API.
type DeviceStore ¶
type DeviceStore interface {
CreateDeviceLogin(context.Context, controlstate.DeviceLoginOptions, time.Time) (controlstate.DeviceLogin, string, error)
ReadDeviceBrowser(context.Context, string, time.Time) (controlstate.DeviceLogin, error)
ResolveLoginTeam(context.Context, string) (string, error)
PrepareCompanyBrowser(context.Context, string, string, string, string, time.Time) (*controlstate.CompanyLoginIntent, error)
PollDeviceLogin(context.Context, string, time.Time) (controlstate.DeviceLogin, error)
CancelDeviceLogin(context.Context, string, time.Time) error
BeginDeviceBrowser(context.Context, string, string, string, string, []byte, string, *controlstate.CompanyLoginIntent, time.Time) error
ConsumeDeviceBrowser(context.Context, string, []byte, time.Time) (controlstate.DeviceLogin, error)
VerifyDeviceBrowser(context.Context, string, []byte, controlstate.OIDCIdentity, time.Time) error
DenyDeviceBrowser(context.Context, string, []byte, time.Time) error
ApproveDeviceLogin(context.Context, string, []byte, string, time.Duration, time.Duration, time.Time) error
}
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.
type Store ¶
type Store interface {
DeviceStore
WorkloadStore
PublisherIdentityStore
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)
GetTeamDomain(context.Context, string, string, string, time.Time) (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
TransferDomain(context.Context, string, string, string, bool, time.Time) (controlstate.DomainTransfer, error)
// contains filtered or unexported methods
}
Store is the stored state used by the built-in authority API.
type WorkloadStore ¶
type WorkloadStore interface {
WorkloadPolicy(context.Context, string, string, string, string) (controlstate.ProjectWorkload, error)
ExchangeWorkload(context.Context, controlstate.ExchangeWorkloadRequest, time.Time) (controlstate.WorkloadSession, error)
RenewWorkloadSession(context.Context, string, string, controlstate.WorkloadRenewal, time.Time) (controlstate.WorkloadSession, error)
RevokeWorkloadSession(context.Context, string, string, time.Time) error
IdentifyWorkload(context.Context, string, string, string, string, oidc.WorkloadExecution, time.Time) (string, error)
WorkloadAssertionPolicy(context.Context, string, string) (controlstate.ProjectWorkload, error)
AttachWorkloadAssertion(context.Context, string, string, oidc.WorkloadExecution, []byte, time.Time) (controlstate.WorkloadSession, error)
}