Documentation
¶
Index ¶
- func GetModuleAs[T any](c *Context, id string) (T, error)
- func Modules() iter.Seq[ModuleInfo]
- func RegisterDepInterface(key string, t reflect.Type)
- func RegisterModule(module Module)
- type App
- type Context
- type Database
- type ExtensionConfig
- type LoadSpec
- type Migrate
- type Module
- type ModuleInfo
- type Provisioner
- type Trust
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetModuleAs ¶
GetModuleAs looks up a loaded module by ID and asserts it to the interface T. It is the type-safe replacement for GetModule.
func Modules ¶
func Modules() iter.Seq[ModuleInfo]
func RegisterDepInterface ¶
RegisterDepInterface associates a dep tag key with the interface type that a dependency named by that key must implement. Call it from a package init(). Duplicate keys panic, mirroring RegisterModule.
func RegisterModule ¶
func RegisterModule(module Module)
Types ¶
type Context ¶
type Context struct {
//nolint:containedctx
context.Context
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext(ctx context.Context) (*Context, context.CancelCauseFunc)
func (*Context) LoadAll ¶
LoadAll loads a set of module specs through four phases so the dependency graph can be validated before any module is provisioned (before side effects such as opening database pools):
Phase 1: flatten specs into pending nodes, recording app->service edges.
Phase 2: instantiate + UnmarshalExtension each node (NO Provision yet).
Phase 3: read dep-tagged fields via reflection and validate the whole graph (every referenced ID present, satisfies its interface, no cycles), aggregating all errors.
Phase 4: provision each node in dependency order (derived by topological sort over the dep-tagged and app->service edges) and register it into the Context, rolling back on failure.
func (*Context) ValidateAll ¶
ValidateAll runs all phases without provisioning anything. It lets an operator or a test check that every referenced module registered, every dependency satisfying its declared interface, no cycles.
type ExtensionConfig ¶
type LoadSpec ¶
type LoadSpec struct {
Cfg ExtensionConfig
IsApp bool
Children []LoadSpec
}
LoadSpec describes one module (or app) to load, together with any child modules an app owns (e.g. a grpc server app and its service modules).
type Module ¶
type Module interface {
Module() ModuleInfo
}
type ModuleInfo ¶
func GetModule ¶
func GetModule(id string) (ModuleInfo, error)
type Provisioner ¶
type Trust ¶
type Trust interface {
// Apply applies and stores the provided Trust.
Apply(ctx context.Context, trust *trustv1.Trust) error
// Block sets the Blocked flag to true for the trust associated with the given tenantID.
// If the trust is already blocked, it does nothing.
// Returns an error if the trust cannot be retrieved or updated.
Block(ctx context.Context, tenantID string) error
// Remove removes the trust for the given tenantID.
Remove(ctx context.Context, tenantID string) error
// Unblock sets the Blocked flag to false for the trust associated with the given tenantID.
// If the trust is not blocked, it does nothing.
// Returns an error if the trust cannot be retrieved or updated.
Unblock(ctx context.Context, tenantID string) error
// Get returns a trust message with optional extensions set.
Get(ctx context.Context, tenantID string) (*trustv1.Trust, error)
}
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
session-manager
command
|
|
|
internal
|
|
|
config
Package config defines the necessary types to configure the application.
|
Package config defines the necessary types to configure the application. |
|
debugtools
Package debugtools contains tools used for debugging the application.
|
Package debugtools contains tools used for debugging the application. |
|
middleware
Package middleware provides utilities to inject the response writer and request reader for the original *http.Request into the context and also retrieve it.
|
Package middleware provides utilities to inject the response writer and request reader for the original *http.Request into the context and also retrieve it. |
|
openapi
Package openapi provides primitives to interact with the openapi HTTP API.
|
Package openapi provides primitives to interact with the openapi HTTP API. |
|
sessionwiring
Package sessionwiring centralises the construction of the long-lived session.Manager that the HTTP API server and the housekeeper subcommand share.
|
Package sessionwiring centralises the construction of the long-lived session.Manager that the HTTP API server and the housekeeper subcommand share. |
|
modules
|
|
|
app/grpcserver
Package grpcserver provides the app.module.grpcserver app module: a long-running gRPC server that hosts service modules registered through its services: config block.
|
Package grpcserver provides the app.module.grpcserver app module: a long-running gRPC server that hosts service modules registered through its services: config block. |
|
credentials/oauth2
Package oauth2 provides the credentials.module.oauth2 module: a credentials.Builder that produces transport credentials for OAuth2/OIDC client authentication.
|
Package oauth2 provides the credentials.module.oauth2 module: a credentials.Builder that produces transport credentials for OAuth2/OIDC client authentication. |
|
grpc/oidcmapping
Package oidcmapping provides the service.module.grpc.oidcmapping module: a gRPC service module that registers the legacy kms.api.cmk.sessionmanager.oidcmapping.v1.Service proto onto a grpc.ServiceRegistrar supplied by app.module.grpcserver.
|
Package oidcmapping provides the service.module.grpc.oidcmapping module: a gRPC service module that registers the legacy kms.api.cmk.sessionmanager.oidcmapping.v1.Service proto onto a grpc.ServiceRegistrar supplied by app.module.grpcserver. |
|
grpc/session
Package session provides the service.module.grpc.session module: a gRPC service module that registers the kms.api.cmk.sessionmanager.session.v1.Service proto onto a grpc.ServiceRegistrar supplied by app.module.grpcserver.
|
Package session provides the service.module.grpc.session module: a gRPC service module that registers the kms.api.cmk.sessionmanager.session.v1.Service proto onto a grpc.ServiceRegistrar supplied by app.module.grpcserver. |
|
grpc/trustmapping
Package trustmapping provides the service.module.grpc.trustmapping module: a gRPC service module that registers the kms.api.cmk.sessionmanager.trustmapping.v1.Service proto onto a grpc.ServiceRegistrar supplied by app.module.grpcserver.
|
Package trustmapping provides the service.module.grpc.trustmapping module: a gRPC service module that registers the kms.api.cmk.sessionmanager.trustmapping.v1.Service proto onto a grpc.ServiceRegistrar supplied by app.module.grpcserver. |
|
sessionstore/valkey
Package valkey provides the sessionstore.module.valkey module: a session.Repository backed by Valkey, configured by the top-level valkey: config block.
|
Package valkey provides the sessionstore.module.valkey module: a session.Repository backed by Valkey, configured by the top-level valkey: config block. |
|
pkg
|
|
