Documentation
¶
Overview ¶
Package controlapi serves the control API and authorizes public URL operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdminStore ¶
type AdminStore interface {
AdminRuntimeCounts(context.Context, time.Time) (controlstate.AdminRuntimeCounts, error)
ListAdminRelayLeases(context.Context, string, time.Time) (controlstate.AdminRelayPage, error)
BeginAdminRelayDrain(context.Context, controlstate.RelayLeaseIdentity, string, string, time.Time, time.Time) (controlstate.RelayLease, error)
ListMaintenanceControls(context.Context) ([]controlstate.MaintenanceControl, error)
SetMaintenanceControl(context.Context, controlstate.MaintenanceControlName, bool, string, string, time.Time) (controlstate.MaintenanceControl, error)
}
AdminStore owns administrator operations.
type BuiltinAuthorizationStore ¶
type BuiltinAuthorizationStore interface {
AuthenticateAccessToken(context.Context, credentials.AccessToken, int64, time.Time) (controlstate.ControlPrincipal, error)
IdentityContext(context.Context, string) (controlstate.IdentityContext, error)
ListTeamDomains(context.Context, string, string) ([]controlstate.Domain, error)
}
BuiltinAuthorizationStore provides the identity state needed for local public URL authorization.
type CertificateStore ¶
type CertificateStore interface {
CreateCertificateIssuance(context.Context, controlstate.CreateCertificateIssuanceRequest, time.Time) (controlstate.CertificateIssuance, error)
GetCertificateIssuance(context.Context, string, credentials.PublishRunToken, time.Time) (controlstate.CertificateIssuance, error)
MarkCertificateChallengeReady(context.Context, string, credentials.PublishRunToken, time.Time) (controlstate.CertificateIssuance, error)
MarkCertificateChallengeRemoved(context.Context, string, credentials.PublishRunToken, time.Time) (controlstate.CertificateIssuance, error)
}
CertificateStore owns publish run certificate issuance state.
type Config ¶
type Config struct {
Role tnldconfig.Role
StartedAt time.Time
ManagedDeploymentDomain string
AuthorityEndpoint string
LoginToken string
OIDCIssuer string
OIDCClientID string
OIDCLoginFlow tnldconfig.OIDCLoginFlow
OIDCScopes []string
CertificateIssuance bool
ACMEDirectoryURL string
ServerDomain string
HostedSecret string
HostedSecretPrevious string
HTTPClient *http.Client
DNSAutomation bool
Metrics *observability.Metrics
Route53CredentialsReadiness func(context.Context) error
ControlReadiness func() error
IngressReadiness func() error
RelayReadiness func() error
}
Config contains the public API settings derived from tnld configuration.
type DNSAuthorityStore ¶
type DNSAuthorityStore interface {
CreateDNSAuthority(context.Context, controlstate.CreateDNSAuthorityRequest, time.Time) (controlstate.DNSAuthority, error)
GetDNSAuthority(context.Context, string) (controlstate.DNSAuthority, error)
ReleaseDNSAuthority(context.Context, string, string, time.Time) (controlstate.DNSAuthority, error)
}
DNSAuthorityStore owns DNS authority references.
type HostedRevocationStore ¶
type HostedRevocationStore interface {
ApplyHostedPolicyRevocation(context.Context, string, string, uint64, bool, []string, []string, time.Time) (bool, int, error)
}
HostedRevocationStore applies policy changes from an external authority.
type PublicURLStore ¶
type PublicURLStore interface {
ListAuthorizedPublicURLs(context.Context, string, string) (controlstate.PublicURLPage, error)
GetAuthorizedPublicURLByHostname(context.Context, string, string) (controlstate.PublicURL, error)
CreatePublicURL(context.Context, controlstate.CreatePublicURLRequest, time.Time) (controlstate.PublicURL, error)
UpdateAuthorizedPublicURL(context.Context, controlstate.AuthorizedPublicURLUpdateRequest, time.Time) (controlstate.PublicURL, error)
GetPublicURLForAuthorization(context.Context, string) (controlstate.PublicURL, error)
GetPublicURLForPublishRunAuthorization(context.Context, string, string) (controlstate.PublicURL, error)
DeleteAuthorizedPublicURL(context.Context, controlstate.AuthorizedPublicURLDeleteRequest, time.Time) error
CreatePublishRun(context.Context, controlstate.PublishRunRequest, time.Time, time.Duration, time.Duration) (controlstate.PublishRunSetup, error)
PublishRunAuthentication(context.Context, string, uint64, credentials.PublishRunToken) (controlstate.PublishRunAuthentication, error)
HeartbeatPublishRun(context.Context, controlstate.PublishRunAuthentication, time.Time, time.Duration, time.Duration) (controlstate.PublishRunSetup, error)
MarkPublicURLCertificateInstalled(context.Context, controlstate.PublishRunAuthentication, string, time.Time, time.Time) (controlstate.PublishRunLifecycle, error)
MarkPublishRunReady(context.Context, controlstate.PublishRunAuthentication, time.Time) (controlstate.PublishRunLifecycle, error)
ClosePublishRun(context.Context, string, credentials.PublishRunToken, time.Time) error
}
PublicURLStore owns saved public URL and publish run state.
type Store ¶
type Store interface {
PublicURLStore
CertificateStore
DNSAuthorityStore
HostedRevocationStore
AdminStore
EnsureExternalAuthorityPrincipal(context.Context, string, time.Time) ([32]byte, error)
}
Store composes the control API's independent state boundaries.
Click to show internal directories.
Click to hide internal directories.