Documentation
¶
Overview ¶
Package deploy implements the credential-scoped, always-waiting release client.
Index ¶
Constants ¶
const MaxResponse = 64 << 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveLookup ¶
ActiveLookup projects the active jobs for the tenant's scoped result reader. xyOps workflow.jobs contains completed stubs only.
type Broker ¶
type Broker struct {
Directory string
Begin func(context.Context, Request, string) error
Start func(context.Context, Request, string) (Launch, error)
Lookup JobLookup
Active ActiveLookup
Lifetime time.Duration
}
Broker hooks are trusted site code. Begin validates OIDC and Forgejo evidence without writing; Start is called only after durable reservation. No caller may select the launch or lookup implementation.
type Client ¶
type Invocation ¶
type Job ¶
type Job struct {
ID string `json:"id"`
Event string `json:"event"`
Source string `json:"source"`
Complete bool `json:"complete"`
Aborted bool `json:"aborted"`
Suspended bool `json:"suspended"`
Replay bool `json:"replay"`
Test bool `json:"test"`
Code json.RawMessage `json:"code"`
Data json.RawMessage `json:"data"`
Parent Parent `json:"parent"`
Workflow Workflow `json:"workflow"`
Jobs []JobRef `json:"jobs"`
}
type Policy ¶
type Policy struct {
Issuer string `json:"issuer"`
Audience string `json:"audience"`
Repository string `json:"repository"`
RepositoryID uint64 `json:"repository_id"`
OwnerID uint64 `json:"owner_id"`
Entry string `json:"entry"`
Rules []Rule `json:"rules"`
}
func (Policy) Verify ¶
func (p Policy) Verify(r Request, token string, keys oidc.KeySet, now time.Time) (*oidc.Claims, Mode, error)
Verify matches the signed token to the existing v1 wire request. The caller must additionally check Forgejo protection/CI and persist a replay reservation before queueing any job or opening deployment credentials.
type Request ¶
type Request struct {
Version int `json:"version"`
Entry string `json:"entry"`
Source Source `json:"source"`
Build Build `json:"build"`
}
func ParseRequest ¶
ParseRequest accepts the canonical v1 wire format used by the released clients.
type Rule ¶
type Rule struct {
Workflow string `json:"workflow"`
Event string `json:"event"`
RefType string `json:"ref_type"` // main or version-tag
Mode Mode `json:"mode"`
}
Rule binds a workflow and an event as one authorization decision. A release cannot opt itself into unattended apply via a request field or CLI flag.