Documentation
¶
Overview ¶
Package deploymentauthorization defines the signed deployment-decision contract shared by the authority and fleet runner.
Index ¶
Constants ¶
const ( SchemaVersion = "v1" Audience = "go_fleet_runner" PayloadType = "application/vnd.domainscope.deployment-authorization.v1+json" MaxEnvelopeBytes = 64 << 10 MaxPayloadBytes = 32 << 10 MaxLifetime = 10 * time.Minute )
Variables ¶
var (
ErrDenied = errors.New("deployment authorization denied")
)
Functions ¶
func SignV1 ¶
func SignV1(intent deploymentintent.V1, principal string, statement Statement, key ed25519.PrivateKey, now time.Time) ([]byte, error)
SignV1 validates and signs a complete allow statement with one Ed25519 key. The key ID appears in both the DSSE envelope and payload so it cannot be confused with an untrusted envelope hint.
Types ¶
type Statement ¶
type Statement struct {
SchemaVersion string `json:"schema_version"`
SigningKeyID string `json:"signing_key_id"`
DecisionID string `json:"decision_id"`
Decision string `json:"decision"`
Audience string `json:"audience"`
Principal string `json:"principal"`
IntentID string `json:"intent_id"`
IntentDigest string `json:"intent_digest"`
ServiceID string `json:"service_id"`
Environment string `json:"environment"`
ArtifactDigest string `json:"artifact_digest"`
SourceCommit string `json:"source_commit"`
TargetPool string `json:"target_pool"`
RollbackDigest string `json:"rollback_digest"`
ApprovalRef string `json:"approval_ref,omitempty"`
ApprovalActor string `json:"approval_actor,omitempty"`
ApprovalVerifiedAt *time.Time `json:"approval_verified_at,omitempty"`
CIProvider string `json:"ci_provider"`
CIRunID string `json:"ci_run_id"`
CIConclusion string `json:"ci_conclusion"`
CISourceCommit string `json:"ci_source_commit"`
ProvenanceIssuer string `json:"provenance_issuer"`
ProvenanceBuilder string `json:"provenance_builder"`
ProvenanceArtifact string `json:"provenance_artifact_digest"`
ProvenanceSourceCommit string `json:"provenance_source_commit"`
PolicyVersion string `json:"policy_version"`
IssuedAt time.Time `json:"issued_at"`
ExpiresAt time.Time `json:"expires_at"`
}
Statement is the exact v1 authority decision payload consumed by go_fleet_runner. It contains evidence summaries only, never raw provider responses, credentials, hostnames, or command text.
type Verified ¶
type Verified struct {
DecisionID string
KeyID string
Principal string
IntentDigest string
PolicyVersion string
ExpiresAt time.Time
}
Verified is returned only for a trusted, correctly bound allow statement.
func VerifyV1 ¶
func VerifyV1(intent deploymentintent.V1, principal string, evidence []byte, trustedKeys map[string]ed25519.PublicKey, now time.Time) (Verified, error)
VerifyV1 verifies a signed allow decision against the already authenticated principal and validated typed intent. Trust keys must come from protected configuration; keys in the evidence are never accepted as trust roots.