Documentation
¶
Index ¶
- Constants
- Variables
- func Attach(mux goahttp.Muxer, service *Service, enabled bool)
- func ValidateAttestorImageReference(value string) error
- type Authority
- func (a Authority) IsPrivate() bool
- func (a Authority) ValidateBaseURL(baseURL string) error
- func (a Authority) ValidateEndpointRef(baseURL string, customDomainID uuid.NullUUID) error
- func (a Authority) ValidateLive(ctx context.Context, db *pgxpool.Pool) error
- func (a Authority) ValidateRequest(ctx context.Context) error
- type Executor
- type ExecutorOptions
- type ExpansionAdmission
- func (a *ExpansionAdmission) CheckExpansion(ctx context.Context, organizationID string) error
- func (a *ExpansionAdmission) PrepareNetworkAccess(ctx context.Context, input networkaccess.EligibilityInput) (networkaccess.AdmissionFinalizer, error)
- func (a *ExpansionAdmission) SetReconcilerReady(ready bool)
- type HealthRefresher
- type OutboxRequester
- type PublicationRequester
- type ReconcileError
- type ReconcileHandler
- type ReconcileRequester
- type ReconcileResult
- type ResourceNames
- type RuntimeConfig
- type Service
- func (s *Service) APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)
- func (s *Service) CheckHealth(ctx context.Context, _ *gen.CheckHealthPayload) (*gen.NetworkIngress, error)
- func (s *Service) CreateIngress(ctx context.Context, payload *gen.CreateIngressPayload) (*gen.NetworkIngress, error)
- func (s *Service) DeleteIngress(ctx context.Context, _ *gen.DeleteIngressPayload) error
- func (s *Service) GetDeleteImpact(ctx context.Context, _ *gen.GetDeleteImpactPayload) (*gen.NetworkIngressDeleteImpact, error)
- func (s *Service) GetIngress(ctx context.Context, _ *gen.GetIngressPayload) (*gen.NetworkIngressResult, error)
- func (s *Service) RotateCredentials(ctx context.Context, payload *gen.RotateCredentialsPayload) (*gen.NetworkIngress, error)
- func (s *Service) UpdateIngress(ctx context.Context, payload *gen.UpdateIngressPayload) (*gen.NetworkIngress, error)
- type Telemetry
Constants ¶
const ( NamespacePlatform = "platform" NamespaceCustomDomain = "custom_domain" )
const ( OperationsMetric = "gram.network_ingress.operation" DurationMetric = "gram.network_ingress.operation.duration" OperationAdmission = "admission" OperationAttestation = "attestation" OperationProxy = "proxy" OperationResolution = "resolution" OperationOAuthAuthority = "oauth_authority" OperationUnknown = "unknown" ResultAllowed = "allowed" ResultDenied = "denied" ResultError = "error" ResultUnknown = "unknown" ReasonNone = "none" ReasonMissingAttestation = "missing_attestation" ReasonInvalidSource = "invalid_source" ReasonAttestationRejected = "attestation_rejected" ReasonHostMismatch = "host_mismatch" ReasonIdentityInvalid = "identity_invalid" ReasonIdentityRequired = "identity_required" ReasonProviderUnsupported = "provider_unsupported" ReasonOriginInvalid = "origin_invalid" ReasonTokenReadFailed = "token_read_failed" ReasonUpstreamFailed = "upstream_failed" ReasonRateLimited = "rate_limited" ReasonCacheHit = "cache_hit" ReasonNegativeCacheHit = "negative_cache_hit" ReasonTokenReviewDenied = "token_review_denied" ReasonAuthorityRejected = "authority_rejected" ReasonNamespaceRejected = "namespace_rejected" ReasonEndpointNotFound = "endpoint_not_found" ReasonPolicyDenied = "policy_denied" ReasonDependencyFailed = "dependency_failed" ReasonUnknown = "unknown" )
const ProviderTailscale = "tailscale"
Variables ¶
ErrAuthorityUnavailable identifies a transient failure to read live ingress authority. Callers should return a retryable service-unavailable response; missing, disabled, deleted, or changed authority remains a terminal denial.
Functions ¶
func ValidateAttestorImageReference ¶
ValidateAttestorImageReference requires a complete OCI image reference pinned to a valid sha256 digest.
Types ¶
type Authority ¶
type Authority struct {
Surface requestorigin.Surface `json:"surface,omitempty"`
BaseURL string `json:"base_url,omitempty"`
OrganizationID string `json:"organization_id,omitempty"`
NetworkIngressID uuid.UUID `json:"network_ingress_id,omitempty"`
NamespaceKind string `json:"namespace_kind,omitempty"`
CustomDomainID uuid.NullUUID `json:"custom_domain_id,omitzero"`
}
Authority is the non-sensitive, provider-neutral request authority pinned to short-lived OAuth state. It intentionally excludes advisory network identity and provider credentials.
func FromRequest ¶
func FromRequest(ctx context.Context, baseURL, organizationID string, customDomainID uuid.NullUUID) Authority
FromRequest captures the mint-time authority already established by request middleware and the resolved endpoint namespace. Absence of Origin preserves TTL-bounded compatibility for internal callers and pre-field cached states.
func LoadRequestAuthority ¶
ValidateLive re-loads the ingress before a global callback performs side effects. A deleted or disabled row is indistinguishable from a missing row. LoadRequestAuthority reconstructs private namespace authority from the live ingress identified by trusted request middleware. It is used by route adapters that need explicit private resolution before the private listener lands.
func (Authority) ValidateBaseURL ¶
ValidateRequest requires a private continuation to arrive through the same attested ingress and externally visible origin. Public/custom continuations retain their existing endpoint checks.
func (Authority) ValidateEndpointRef ¶
ValidateEndpointRef ensures the duplicated endpoint-address fields used for rolling compatibility agree with the authoritative namespace snapshot.
func (Authority) ValidateLive ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor reconciles one ingress at a time across all workers and attempts.
func NewExecutor ¶
func NewExecutor(db *pgxpool.Pool, enc *encryption.Client, registry *k8s.NetworkIngressProvisionerRegistry, options ExecutorOptions) *Executor
func (*Executor) FindOrphans ¶
FindOrphans reports unmatched provider resources; it never deletes them.
type ExecutorOptions ¶
type ExecutorOptions struct {
// Queue is the authoritative reconciliation task queue.
Queue string
// Image is the attestor image used by Apply.
Image string
// BackendService is the private backend Service name.
BackendService string
// BackendPort is the private backend Service port.
BackendPort int32
// CanApply is checked on every attempt before credential decryption.
CanApply func(context.Context) error
// PublicationRequester atomically records organization invalidations for
// committed DNS authority changes. A nil requester keeps the producer off.
PublicationRequester PublicationRequester
// PublicationActor identifies the reconciler actor in publication hints.
PublicationActor string
}
ExecutorOptions contains only runtime configuration, never provider credentials.
type ExpansionAdmission ¶
type ExpansionAdmission struct {
// contains filtered or unexported fields
}
ExpansionAdmission authorizes actions that expand private-network access. Durable entitlement and global runtime readiness are both required. Missing, disabled, or errored state fails closed.
func NewExpansionAdmission ¶
func NewExpansionAdmission(features *productfeatures.Client, ready, enabled bool) *ExpansionAdmission
func (*ExpansionAdmission) CheckExpansion ¶
func (a *ExpansionAdmission) CheckExpansion(ctx context.Context, organizationID string) error
func (*ExpansionAdmission) PrepareNetworkAccess ¶
func (a *ExpansionAdmission) PrepareNetworkAccess(ctx context.Context, input networkaccess.EligibilityInput) (networkaccess.AdmissionFinalizer, error)
func (*ExpansionAdmission) SetReconcilerReady ¶
func (a *ExpansionAdmission) SetReconcilerReady(ready bool)
type HealthRefresher ¶
HealthRefresher waits only for an interactive refresh, not for config writes.
type OutboxRequester ¶
type OutboxRequester struct {
// contains filtered or unexported fields
}
OutboxRequester routes lifecycle wakes to the environment's authoritative queue.
func NewOutboxRequester ¶
func NewOutboxRequester(queue string) *OutboxRequester
type PublicationRequester ¶
PublicationRequester atomically records an organization publication hint. Implementations must not commit the transaction or perform external work.
type ReconcileError ¶
type ReconcileError struct {
// Code is a bounded diagnostic suitable for orchestration history.
Code string
// Retryable controls retries within the current workflow run.
Retryable bool
}
ReconcileError deliberately has no wrapped cause or provider-supplied message.
func (*ReconcileError) Error ¶
func (e *ReconcileError) Error() string
type ReconcileHandler ¶
type ReconcileHandler struct {
// contains filtered or unexported fields
}
ReconcileHandler coalesces durable wakes by ingress before contacting Temporal.
func NewReconcileHandler ¶
func (*ReconcileHandler) HandleBatchWithResult ¶
func (h *ReconcileHandler) HandleBatchWithResult(ctx context.Context, messages []streams.BatchMessage[*networkingressv1.ReconcileRequested]) error
type ReconcileRequester ¶
ReconcileRequester atomically records lifecycle work with its desired state.
type ReconcileResult ¶
type ReconcileResult struct {
// Requeue means desired state changed during this pass.
Requeue bool
}
ReconcileResult is safe to persist in orchestration history.
type ResourceNames ¶
type ResourceNames = k8s.NetworkIngressResourceNames
ResourceNames aliases the canonical provider-neutral resource identity contract owned by the Kubernetes provisioner layer.
func NewResourceNames ¶
func NewResourceNames(id uuid.UUID) (ResourceNames, error)
NewResourceNames is retained for compatibility with management callers while delegating construction and validation to the canonical provisioner contract.
type RuntimeConfig ¶
type RuntimeConfig struct {
// ReconcileTaskQueue is explicit and never falls back to a general worker queue.
ReconcileTaskQueue string
// ProviderMutationsEnabled permits apply and rotation, not admission or cleanup.
ProviderMutationsEnabled bool
// Tailscale configures operator resources and private backend network access.
Tailscale k8s.TailscaleNetworkIngressConfig
// AttestorImage is the digest-pinned image deployed for each ingress.
AttestorImage string
// BackendService names the private HTTPS Service in Tailscale.BackendNamespace.
BackendService string
// BackendPort is the private HTTPS Service port; zero means unconfigured.
BackendPort int32
// IngressClass must explicitly select the supported tailscale ingress class.
IngressClass string
// TokenAudience must match the private listener's projected token audience.
TokenAudience string
}
RuntimeConfig separates optional lifecycle configuration from permission to apply provider changes. Its zero value disables lifecycle delivery and mutation.
func (RuntimeConfig) MutationReady ¶
func (c RuntimeConfig) MutationReady() bool
MutationReady reports configuration readiness for apply and rotation only. Callers must independently verify clients and admission integration readiness. Observe and Delete must not depend on this result.
func (RuntimeConfig) Validate ¶
func (c RuntimeConfig) Validate() error
Validate rejects invalid supplied values without requiring apply-only settings. Missing configuration leaves mutation unavailable without preventing cleanup.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(logger *slog.Logger, tracerProvider trace.TracerProvider, db *pgxpool.Pool, sessions *sessions.Manager, authzEngine *authz.Engine, enc *encryption.Client, auditLogger *audit.Logger, admission *ExpansionAdmission, requester ReconcileRequester, health HealthRefresher) *Service
func NewServiceWithPublication ¶
func NewServiceWithPublication(logger *slog.Logger, tracerProvider trace.TracerProvider, db *pgxpool.Pool, sessions *sessions.Manager, authzEngine *authz.Engine, enc *encryption.Client, auditLogger *audit.Logger, admission *ExpansionAdmission, requester ReconcileRequester, publicationRequester PublicationRequester, health HealthRefresher) *Service
NewServiceWithPublication configures the optional durable publication invalidator. A nil requester preserves the dormant producer behavior.
func (*Service) APIKeyAuth ¶
func (*Service) CheckHealth ¶
func (s *Service) CheckHealth(ctx context.Context, _ *gen.CheckHealthPayload) (*gen.NetworkIngress, error)
func (*Service) CreateIngress ¶
func (s *Service) CreateIngress(ctx context.Context, payload *gen.CreateIngressPayload) (*gen.NetworkIngress, error)
func (*Service) DeleteIngress ¶
func (*Service) GetDeleteImpact ¶
func (s *Service) GetDeleteImpact(ctx context.Context, _ *gen.GetDeleteImpactPayload) (*gen.NetworkIngressDeleteImpact, error)
func (*Service) GetIngress ¶
func (s *Service) GetIngress(ctx context.Context, _ *gen.GetIngressPayload) (*gen.NetworkIngressResult, error)
func (*Service) RotateCredentials ¶
func (s *Service) RotateCredentials(ctx context.Context, payload *gen.RotateCredentialsPayload) (*gen.NetworkIngress, error)
func (*Service) UpdateIngress ¶
func (s *Service) UpdateIngress(ctx context.Context, payload *gen.UpdateIngressPayload) (*gen.NetworkIngress, error)
type Telemetry ¶
type Telemetry struct {
// contains filtered or unexported fields
}
func NewTelemetry ¶
func NewTelemetry(logger *slog.Logger, meterProvider metric.MeterProvider) *Telemetry