Documentation
¶
Index ¶
- Constants
- Variables
- func AttachWorkContext(request *http.Request, token WorkContextToken) error
- func CatchPanic(ctx context.Context)
- func Context() context.Context
- func Environment() string
- func Fixture() string
- func GetLogLevel() wool.Loglevel
- func Init(ctx context.Context) (*wool.Provider, error)
- func IsLocal() bool
- func LoadEnvironmentVariables() error
- func ScopedAuthSecret() string
- func ServiceVersion() string
- func WithFixture(fixture string) bool
- type Query
- func (q *Query) API(name string) *Query
- func (q *Query) Configuration(key string, name string) (string, error)
- func (q *Query) Endpoint(name string) *Query
- func (q *Query) Module(s string) *Query
- func (q *Query) NetworkInstance() *resources.NetworkInstance
- func (q *Query) Normalize()
- func (q *Query) Secret(key string, name string) (string, error)
- func (q *Query) Service(s string) *Query
- func (q *Query) WithDefaultNetwork() *Query
- func (q *Query) WorkspaceConfiguration(name string, key string) (string, error)
- func (q *Query) WorkspaceSecret(name string, key string) (string, error)
- func (q *Query) WorkspaceValue(name string, key string) (string, error)
- type StartChildSessionInput
- type StartRootSessionInput
- type StartTaskInput
- type WorkContextExpectations
- type WorkContextSigner
- func (s *WorkContextSigner) StartChildSession(parent WorkContextToken, input StartChildSessionInput) (WorkContextToken, *basev0.WorkContextV1, error)
- func (s *WorkContextSigner) StartSession(parent WorkContextToken, input StartRootSessionInput) (WorkContextToken, *basev0.WorkContextV1, error)
- func (s *WorkContextSigner) StartTask(input StartTaskInput) (WorkContextToken, *basev0.WorkContextV1, error)
- type WorkContextSignerOptions
- type WorkContextToken
- type WorkContextVerifier
- type WorkContextVerifierOptions
Constants ¶
const ( // WorkContextHeaderName is the only HTTP carrier for a signed Work Context. // Product code should call AttachWorkContext instead of naming this header. WorkContextHeaderName = "x-codefly-work-context" WorkContextType = "codefly.work-context/v1" WorkContextAlgorithm = "Ed25519" WorkContextReplayIdempotent = "idempotent" WorkContextReplaySingleUse = "single-use" WorkContextMaxActorDepth = 16 WorkContextMaxTokenBytes = 32 * 1024 )
Variables ¶
Functions ¶
func AttachWorkContext ¶ added in v0.1.51
func AttachWorkContext(request *http.Request, token WorkContextToken) error
AttachWorkContext installs a token without exposing the carrier name to application code.
func CatchPanic ¶ added in v0.0.7
func Context ¶ added in v0.1.42
Context returns the provider-injected context built by Init (so wool.Get sees the SDK provider), or context.Background() before Init has run.
func Environment ¶ added in v0.1.46
func Environment() string
Environment returns the Codefly environment selected for this process. The representation is owned by the SDK; product code must not read its carrier.
func Fixture ¶ added in v0.1.46
func Fixture() string
Fixture returns the fixture selected by the Codefly runtime. Product code must not depend on the runtime's environment-variable representation.
func GetLogLevel ¶ added in v0.0.11
func IsLocal ¶ added in v0.1.46
func IsLocal() bool
IsLocal reports whether the current Codefly environment is local.
func LoadEnvironmentVariables ¶ added in v0.0.7
func LoadEnvironmentVariables() error
func ScopedAuthSecret ¶ added in v0.1.46
func ScopedAuthSecret() string
ScopedAuthSecret returns the host-issued plugin authentication secret. This legacy carrier remains encapsulated here until scoped auth moves to a typed capability; product code must not read it directly.
func ServiceVersion ¶ added in v0.1.39
func ServiceVersion() string
func WithFixture ¶ added in v0.1.32
Types ¶
type Query ¶ added in v0.1.24
type Query struct {
// contains filtered or unexported fields
}
func (*Query) Configuration ¶ added in v0.1.24
func (*Query) Endpoint ¶ added in v0.1.41
Endpoint sets the endpoint name independently from the API type. Use when the endpoint name differs from the API protocol. Example: codefly.For(ctx).Service("neo4j").Endpoint("bolt").API("tcp")
func (*Query) NetworkInstance ¶ added in v0.1.24
func (q *Query) NetworkInstance() *resources.NetworkInstance
func (*Query) WithDefaultNetwork ¶ added in v0.1.25
func (*Query) WorkspaceConfiguration ¶ added in v0.1.46
WorkspaceConfiguration returns one non-secret workspace configuration value. Product services must use this API instead of depending on Codefly's environment variable encoding, which is an SDK/runtime implementation detail.
func (*Query) WorkspaceSecret ¶ added in v0.1.46
WorkspaceSecret returns one secret workspace configuration value without exposing Codefly's environment variable encoding to the caller.
func (*Query) WorkspaceValue ¶ added in v0.1.46
WorkspaceValue resolves a workspace value from the public namespace first, then the secret namespace. It is intended for settings whose sensitivity is deployment-defined while preserving a single SDK-only lookup boundary.
type StartChildSessionInput ¶ added in v0.1.51
type StartChildSessionInput struct {
SessionID string
Audience string
Actor *basev0.WorkActorV1
ReplayPolicy string
TTL time.Duration
}
StartChildSessionInput appends exactly one verified Actor and creates a child Session. The new actor's scopes must attenuate the parent's effective scope.
type StartRootSessionInput ¶ added in v0.1.51
type StartRootSessionInput struct {
SessionID string
Audience string
ReplayPolicy string
TTL time.Duration
}
StartRootSessionInput exchanges a valid capability for another root Session under the same Task. Identity, owner, scopes, actors, and attribution cannot be changed by the caller.
type StartTaskInput ¶ added in v0.1.51
type StartTaskInput struct {
Audience string
TenantID string
OwnerPrincipalID string
TaskID string
SessionID string
AuthorizationRevision uint64
ReplayPolicy string
AuthorityScopes []*basev0.WorkScopeV1
ActorChain []*basev0.WorkActorV1
AttributionTeamIDs []string
WorkspaceID string
ProjectID string
TTL time.Duration
NotBefore time.Time
}
StartTaskInput creates a Task and its first root Session capability.
type WorkContextExpectations ¶ added in v0.1.51
type WorkContextSigner ¶ added in v0.1.51
type WorkContextSigner struct {
// contains filtered or unexported fields
}
WorkContextSigner is an authority-side capability. Product applications should receive tokens from an authority/exchange endpoint, not receive this signer or its private key.
func NewWorkContextSigner ¶ added in v0.1.51
func NewWorkContextSigner(options WorkContextSignerOptions) (*WorkContextSigner, error)
func (*WorkContextSigner) StartChildSession ¶ added in v0.1.51
func (s *WorkContextSigner) StartChildSession(parent WorkContextToken, input StartChildSessionInput) (WorkContextToken, *basev0.WorkContextV1, error)
func (*WorkContextSigner) StartSession ¶ added in v0.1.51
func (s *WorkContextSigner) StartSession(parent WorkContextToken, input StartRootSessionInput) (WorkContextToken, *basev0.WorkContextV1, error)
func (*WorkContextSigner) StartTask ¶ added in v0.1.51
func (s *WorkContextSigner) StartTask(input StartTaskInput) (WorkContextToken, *basev0.WorkContextV1, error)
StartTask constructs and signs an immutable Task/root-Session context.
type WorkContextSignerOptions ¶ added in v0.1.51
type WorkContextToken ¶ added in v0.1.51
type WorkContextToken struct {
// contains filtered or unexported fields
}
WorkContextToken is an opaque signed capability. Its encoded representation is exposed only for storage and transport adapters; use AttachWorkContext for HTTP requests and WorkContextVerifier for trust decisions.
func ParseWorkContextToken ¶ added in v0.1.51
func ParseWorkContextToken(encoded string) (WorkContextToken, error)
ParseWorkContextToken validates only the bounded two-segment wire shape. It does not establish trust; call WorkContextVerifier.Verify before using claims.
func WorkContextFromHeaders ¶ added in v0.1.51
func WorkContextFromHeaders(headers http.Header) (WorkContextToken, error)
WorkContextFromHeaders extracts an opaque token. It does not verify it.
func (WorkContextToken) Encoded ¶ added in v0.1.51
func (t WorkContextToken) Encoded() string
Encoded returns the signed wire value for persistence or a non-HTTP transport.
type WorkContextVerifier ¶ added in v0.1.51
type WorkContextVerifier struct {
// contains filtered or unexported fields
}
func NewWorkContextVerifier ¶ added in v0.1.51
func NewWorkContextVerifier(options WorkContextVerifierOptions) (*WorkContextVerifier, error)
func (*WorkContextVerifier) Verify ¶ added in v0.1.51
func (v *WorkContextVerifier) Verify(token WorkContextToken, expected WorkContextExpectations) (*basev0.WorkContextV1, error)
