Documentation
¶
Overview ¶
Package googlecloudlogs4datatug provides durable host adapters for personal Cloud Logging grants. It stores no log entries, filters, or query results.
Index ¶
- type ActivationLifecycle
- func (l *ActivationLifecycle) Pause(ctx context.Context, uid string, expected uint64) (logs.ActivationStatus, error)
- func (l *ActivationLifecycle) Reconcile(ctx context.Context, uid string, expected uint64, limit int) (logs.ActivationReconciliation, error)
- func (l *ActivationLifecycle) Resume(ctx context.Context, uid string, expected uint64) (logs.ActivationStatus, error)
- func (l *ActivationLifecycle) Status(ctx context.Context, uid string) (logs.ActivationStatus, error)
- type KMSClient
- type OAuth
- func (o *OAuth) AuthorizationURL(a personalcloudlogs4datatug.Authorization) (string, error)
- func (o *OAuth) Exchange(ctx context.Context, e personalcloudlogs4datatug.Exchange) (personalcloudlogs4datatug.GoogleIdentity, error)
- func (o *OAuth) Refresh(ctx context.Context, refreshToken string) (string, time.Time, error)
- func (o *OAuth) Revoke(ctx context.Context, refreshToken string) error
- type OAuthConfig
- type Operations
- type QuiescenceVerifier
- type QuiescenceVerifierFunc
- type Reader
- type Registry
- func (r *Registry) ActivateCompletion(ctx context.Context, uid, receipt, finish, project string, now time.Time) (logs.Grant, error)
- func (r *Registry) BeginDisconnect(ctx context.Context, uid, id string, now time.Time) (logs.Grant, error)
- func (r *Registry) ConsumePending(ctx context.Context, hash string, now time.Time) (logs.Pending, error)
- func (r *Registry) CreateConnection(ctx context.Context, c logs.Connection) error
- func (r *Registry) FinishCleanup(ctx context.Context, id, generation string, confirmed bool) error
- func (r *Registry) GetConnection(ctx context.Context, uid, id string) (logs.Connection, error)
- func (r *Registry) GetGrant(ctx context.Context, uid, id string) (logs.Grant, error)
- func (r *Registry) List(ctx context.Context, uid string) (logs.Listing, error)
- func (r *Registry) PendingCleanup(ctx context.Context, limit int) ([]logs.Grant, error)
- func (r *Registry) PurgeExpired(ctx context.Context, now time.Time, limit int) error
- func (r *Registry) RemoveConnection(ctx context.Context, uid, id string) error
- func (r *Registry) SaveCompletion(ctx context.Context, c logs.Completion) error
- func (r *Registry) SavePending(ctx context.Context, p logs.Pending) error
- type RevokeFunc
- type Revoker
- type Vault
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivationLifecycle ¶
type ActivationLifecycle struct {
// contains filtered or unexported fields
}
ActivationLifecycle coordinates the durable activation fence with the existing personal Cloud Logs service cleanup path.
func NewActivationLifecycle ¶
func NewActivationLifecycle(service *logs.Service, registry *Registry) (*ActivationLifecycle, error)
NewActivationLifecycle binds lifecycle controls to the same registry used by the service. The host supplies its fixed pilot UID at each invocation.
func (*ActivationLifecycle) Pause ¶
func (l *ActivationLifecycle) Pause(ctx context.Context, uid string, expected uint64) (logs.ActivationStatus, error)
func (*ActivationLifecycle) Reconcile ¶
func (l *ActivationLifecycle) Reconcile(ctx context.Context, uid string, expected uint64, limit int) (logs.ActivationReconciliation, error)
func (*ActivationLifecycle) Resume ¶
func (l *ActivationLifecycle) Resume(ctx context.Context, uid string, expected uint64) (logs.ActivationStatus, error)
func (*ActivationLifecycle) Status ¶
func (l *ActivationLifecycle) Status(ctx context.Context, uid string) (logs.ActivationStatus, error)
type KMSClient ¶
type KMSClient interface {
Encrypt(context.Context, *kmspb.EncryptRequest, ...gax.CallOption) (*kmspb.EncryptResponse, error)
Decrypt(context.Context, *kmspb.DecryptRequest, ...gax.CallOption) (*kmspb.DecryptResponse, error)
}
KMSClient is implemented by Cloud KMS KeyManagementClient. A single service identity with narrow Encrypt/Decrypt permission supplies this client.
type OAuth ¶
type OAuth struct {
// contains filtered or unexported fields
}
func NewOAuth ¶
func NewOAuth(config OAuthConfig) (*OAuth, error)
func (*OAuth) AuthorizationURL ¶
func (o *OAuth) AuthorizationURL(a personalcloudlogs4datatug.Authorization) (string, error)
AuthorizationURL accepts only the server-generated state, nonce and S256 challenge.
func (*OAuth) Exchange ¶
func (o *OAuth) Exchange(ctx context.Context, e personalcloudlogs4datatug.Exchange) (personalcloudlogs4datatug.GoogleIdentity, error)
Exchange performs the code exchange on the server and verifies the signed ID token before any Google subject is exposed to the service.
func (*OAuth) Refresh ¶
Refresh uses only the delegated refresh token. Callers keep the returned access token in bounded server memory and fence the grant generation before use.
type OAuthConfig ¶
OAuthConfig is supplied only by the server's trusted Cloud Logs web client, configured in the shared Google Cloud project used by Sneat authentication. ClientSecret must never be returned to a browser or put in a URL.
type Operations ¶
type Operations struct {
// contains filtered or unexported fields
}
Operations stores generation leases in Firestore. Polling propagates a revocation fence across processes, while the service checks context after every provider call before exposing a result.
func NewOperations ¶
func NewRecoveryOperations ¶
func NewRecoveryOperations(db dal.DB, revoker Revoker, now func() time.Time, verifier QuiescenceVerifier) (*Operations, error)
NewRecoveryOperations must be used only in a host operator worker whose verifier checks the operator identity and a deployment-wide stop receipt. Ordinary serving instances use NewOperations and cannot clear orphan leases.
func (*Operations) Acquire ¶
func (o *Operations) Acquire(ctx context.Context, g logs.Grant, c *logs.Connection) (context.Context, func(), error)
func (*Operations) ReconcileQuiesced ¶
ReconcileQuiesced is an explicit last-resort recovery for a process that died before releasing a lease or recording revocation. A separately configured recovery worker must verify authenticated, auditable evidence of quiescence; time expiry never unlocks it. The proof must cover the entire worker deployment capable of this grant generation, not merely the instance calling this method. No browser path should expose this operation.
type QuiescenceVerifier ¶
QuiescenceVerifier is configured only on an administrative Operations instance. It authenticates operator evidence and authoritatively establishes that every process able to run provider work for this generation has stopped, including a stalled revocation attempt, and cannot resume. Clock deadlines and heartbeats are insufficient. The closed Firestore fence rejects new work.
type QuiescenceVerifierFunc ¶
func (QuiescenceVerifierFunc) VerifyQuiesced ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader performs request-scoped delegated reads. The domain Service must acquire a generation lease before calling it and reauthorize before publishing results. It retains neither credentials nor results across requests.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry uses DALgo's Firestore DB; transactions must be backed by Firestore, never an eventually consistent in-memory substitute in production.
func (*Registry) ActivateCompletion ¶
func (*Registry) BeginDisconnect ¶
func (*Registry) ConsumePending ¶
func (*Registry) CreateConnection ¶
func (*Registry) FinishCleanup ¶
func (*Registry) GetConnection ¶
func (*Registry) PendingCleanup ¶
func (*Registry) PurgeExpired ¶
func (*Registry) RemoveConnection ¶
func (*Registry) SaveCompletion ¶
type RevokeFunc ¶
type Revoker ¶
Revoker receives an already sealed grant. It must use the delegated token after opening it through the host vault; this adapter never logs its value. A false, nil result means Google did not confirm revocation.