Documentation
¶
Index ¶
- Variables
- func PrincipalFromContext(ctx context.Context) (cloudauth.Principal, bool)
- func WithPrincipal(ctx context.Context, principal cloudauth.Principal) context.Context
- type AdminIdentityStore
- type Authenticator
- type ChunkStore
- type CloudServer
- type EnrolledProjectsProvider
- type MutationEntry
- type MutationStore
- type Option
- func WithAdminIdentityStore(store AdminIdentityStore) Option
- func WithDashboardAdminToken(adminToken string) Option
- func WithHost(host string) Option
- func WithManagedTokenHasher(hasher *cloudauth.ManagedTokenHasher) Option
- func WithMaxPushBodyBytes(limit int64) Option
- func WithPrincipalProjectAuthorizer(authorizer PrincipalProjectAuthorizer) Option
- func WithPrincipalStateStore(store principalStateStore) Option
- func WithProjectAuthorizer(authorizer ProjectAuthorizer) Option
- func WithSyncStatusProvider(provider dashboard.SyncStatusProvider) Option
- type PrincipalProjectAuthorizer
- type ProjectAuthorizer
- type StoredMutation
Constants ¶
This section is empty.
Variables ¶
var ErrDashboardSessionCodecRequired = errors.New("dashboard session codec is required for dashboard auth")
Functions ¶
func PrincipalFromContext ¶ added in v1.18.0
Types ¶
type AdminIdentityStore ¶ added in v1.18.0
type AdminIdentityStore interface {
CreateHumanUser(ctx context.Context, params cloudstore.CreateHumanUserParams) (cloudstore.HumanUser, error)
ListHumanUsers(ctx context.Context) ([]cloudstore.HumanUser, error)
SetHumanUserEnabled(ctx context.Context, principalID string, enabled bool) error
CreatePrincipalTokenWithAudit(ctx context.Context, params cloudstore.CreatePrincipalTokenParams, audit cloudstore.AuthAuditEvent) (cloudstore.PrincipalToken, error)
ListPrincipalTokens(ctx context.Context, principalID string) ([]cloudstore.PrincipalToken, error)
RevokePrincipalToken(ctx context.Context, tokenID, revokedByPrincipalID, reason string) error
CreateProjectGrant(ctx context.Context, params cloudstore.CreateProjectGrantParams) (cloudstore.ProjectGrant, error)
ListProjectGrants(ctx context.Context, principalID string) ([]cloudstore.ProjectGrant, error)
RevokeProjectGrant(ctx context.Context, principalID, project string) error
InsertAuthAuditEvent(ctx context.Context, event cloudstore.AuthAuditEvent) error
}
AdminIdentityStore is the storage boundary used by cloudserver admin API handlers. CloudStore satisfies it through the identity methods added in the storage foundation slice.
type Authenticator ¶ added in v1.13.0
type ChunkStore ¶ added in v1.13.0
type ChunkStore interface {
ReadManifest(ctx context.Context, project string) (*engramsync.Manifest, error)
WriteChunk(ctx context.Context, project, chunkID, createdBy, clientCreatedAt string, payload []byte) error
ReadChunk(ctx context.Context, project, chunkID string) ([]byte, error)
KnownSessionIDs(ctx context.Context, project string) (map[string]struct{}, error)
}
type CloudServer ¶
type CloudServer struct {
// contains filtered or unexported fields
}
func New ¶
func New(store ChunkStore, authSvc Authenticator, port int, opts ...Option) *CloudServer
func (*CloudServer) Handler ¶
func (s *CloudServer) Handler() http.Handler
func (*CloudServer) Start ¶
func (s *CloudServer) Start() error
type EnrolledProjectsProvider ¶ added in v1.13.0
type EnrolledProjectsProvider interface {
EnrolledProjects() []string
}
EnrolledProjectsProvider is an optional extension of ProjectAuthorizer that returns the list of enrolled projects for the authenticated caller.
type MutationEntry ¶ added in v1.13.0
type MutationEntry = cloudstore.MutationEntry
MutationEntry is an alias for cloudstore.MutationEntry (canonical wire type). Using a type alias ensures cloudstore.CloudStore satisfies MutationStore without adapter shims.
type MutationStore ¶ added in v1.13.0
type MutationStore interface {
InsertMutationBatch(ctx context.Context, batch []cloudstore.MutationEntry) ([]int64, error)
ListMutationsSince(ctx context.Context, sinceSeq int64, limit int, allowedProjects []string) ([]cloudstore.StoredMutation, bool, int64, error)
IsProjectSyncEnabled(project string) (bool, error)
}
MutationStore is the subset of store methods needed by mutation handlers. It is satisfied by cloudstore.CloudStore and by test fakes. BC1: Using cloudstore types directly (via alias) ensures the type assertion s.store.(MutationStore) succeeds at runtime with a real *cloudstore.CloudStore.
type Option ¶
type Option func(*CloudServer)
func WithAdminIdentityStore ¶ added in v1.18.0
func WithAdminIdentityStore(store AdminIdentityStore) Option
func WithDashboardAdminToken ¶ added in v1.13.0
func WithManagedTokenHasher ¶ added in v1.18.0
func WithManagedTokenHasher(hasher *cloudauth.ManagedTokenHasher) Option
func WithMaxPushBodyBytes ¶ added in v1.15.14
func WithPrincipalProjectAuthorizer ¶ added in v1.18.0
func WithPrincipalProjectAuthorizer(authorizer PrincipalProjectAuthorizer) Option
func WithPrincipalStateStore ¶ added in v1.18.0
func WithPrincipalStateStore(store principalStateStore) Option
func WithProjectAuthorizer ¶ added in v1.13.0
func WithProjectAuthorizer(authorizer ProjectAuthorizer) Option
func WithSyncStatusProvider ¶ added in v1.13.0
func WithSyncStatusProvider(provider dashboard.SyncStatusProvider) Option
type PrincipalProjectAuthorizer ¶ added in v1.18.0
type ProjectAuthorizer ¶ added in v1.13.0
type StoredMutation ¶ added in v1.13.0
type StoredMutation = cloudstore.StoredMutation
StoredMutation is an alias for cloudstore.StoredMutation (canonical read type).