Documentation
¶
Overview ¶
Package permissions defines recipe grants independently of JobDB's token format.
Index ¶
- Constants
- func WithAccess(ctx context.Context, access *Access) context.Context
- type Access
- func (a *Access) CheckSecrets(names []string) error
- func (a *Access) Context() context.Context
- func (a *Access) Grant() JobDB
- func (a *Access) LimitDeadline(deadline time.Time) context.CancelFunc
- func (a *Access) Resolve(ctx context.Context, names []string) (jobdb.SecretResolveResult, error)
- func (a *Access) Submit(ctx context.Context, job jobdb.SubmitJob) (jobref.Ref, error)
- type Issuer
- type JobDB
- type JobDBIssuer
- type JobPermissions
- type Limit
- type ResolveFunc
- type SecretPermissions
- type Spec
- type State
- type SubmitFunc
- type TaskDelegator
Constants ¶
const Version = 1
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Access ¶
type Access struct {
// contains filtered or unexported fields
}
Access checks every use before consulting a resolver, including cached ones. Callbacks belong to the controller and are never serialized into task input.
func FromContext ¶
func NewAccess ¶
func NewAccess(ctx context.Context, grant JobDB, resolve ResolveFunc, submit SubmitFunc) *Access
func (*Access) CheckSecrets ¶
func (*Access) LimitDeadline ¶
func (a *Access) LimitDeadline(deadline time.Time) context.CancelFunc
LimitDeadline narrows helper calls as soon as an operation-local timeout is known. Already issued credentials stay private to the trusted helper; later calls use a credential bounded by the narrower deadline.
type Issuer ¶
type Issuer interface {
IssueRestrictedLease(context.Context, TaskDelegator, JobDB, time.Time) (jobdb.ExecutionLease, error)
}
Issuer is the single integration boundary for credential creation. The deadline is an optional operation limit; JobDB supplies execution bounds.
type JobDB ¶
type JobDB struct {
Secrets SecretPermissions `yaml:"secrets,omitempty" json:"secrets,omitempty"`
Jobs JobPermissions `yaml:"jobs,omitempty" json:"jobs,omitempty"`
}
type JobDBIssuer ¶
type JobDBIssuer struct{}
JobDBIssuer uses task-scoped local attenuation. The caller context controls cancellation only; its request timeout must not become a credential deadline.
func (JobDBIssuer) IssueRestrictedLease ¶
func (i JobDBIssuer) IssueRestrictedLease(ctx context.Context, task TaskDelegator, grant JobDB, deadline time.Time) (jobdb.ExecutionLease, error)
type JobPermissions ¶
type JobPermissions struct {
Submit bool `yaml:"submit,omitempty" json:"submit,omitempty"`
}
type ResolveFunc ¶
type SecretPermissions ¶
type SecretPermissions struct {
Resolve []string `yaml:"resolve,omitempty" json:"resolve,omitempty"`
}
type Spec ¶
type Spec struct {
JobDB *JobDB `yaml:"jobdb,omitempty" json:"jobdb,omitempty"`
Limit *Limit `yaml:"limit,omitempty" json:"limit,omitempty"`
}
Spec is common node metadata. A nil JobDB inherits; a nonnil empty grant denies.
func (Spec) JSONSchema ¶
func (Spec) JSONSchema() *jsonschema.Schema
func (*Spec) UnmarshalYAML ¶
Reject unknown fields, nulls, aliases and merges rather than silently ignoring an intended restriction. This strictness is local to the permission subtree.
type State ¶
type State struct {
Version int `json:"version"`
Grant *JobDB `json:"grant,omitempty"`
Limit *JobDB `json:"limit,omitempty"`
}
State is immutable lexical policy, serialized with each task invocation. It preserves the distinction between explicit grants and automatic Git defaults.
func (*State) UnmarshalJSON ¶
type TaskDelegator ¶
type TaskDelegator interface {
CreateDelegation(context.Context, jobdb.CreateDelegationRequest) (jobdb.RenewableExecutionLease, error)
}
TaskDelegator is the live task's engine-owned delegation capability. A copy of workflow.TaskContext preserves it; a reconstructed context does not.