Documentation
¶
Overview ¶
Package cockpitaction binds browser-approved dispositions to exact, signed snapshots. Its payload is held by the existing durable operation queue.
Index ¶
- func ApplySigned(ctx context.Context, publicKey, signed, executable string, ...) error
- func Execute(ctx context.Context, p Payload, executable string, ports Ports, ...) error
- func Sign(p Payload, private []byte) (string, error)
- func ValidateAction(action string, s Snapshot, comment string) error
- type Payload
- type Ports
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplySigned ¶
func ApplySigned(ctx context.Context, publicKey, signed, executable string, out, errOut io.Writer) error
ApplySigned receives its public key and immutable payload through the existing authenticated worker assignment. This is not a standalone authorization API: the queue controls both arguments and a worker operation must already exist.
Types ¶
type Payload ¶
type Payload struct {
Action string
Target Snapshot
Comment, Root, Worker, Key string
Expires time.Time
}
Payload contains no credential and accepts no user-supplied command.
type Ports ¶
type Ports struct {
Read func(context.Context, string, string, ...string) (string, error)
PR func(context.Context, string, string) (githubchecks.PullRequestView, error)
Run func(context.Context, string, string, []string, io.Writer, io.Writer) error
Remote func(context.Context, string, string) (string, error)
Now func() time.Time
}
Ports keeps unit tests entirely away from real GitHub and fleet mutations.
func DefaultPorts ¶
func DefaultPorts() Ports