Documentation
¶
Index ¶
Constants ¶
const ( ProfileIssuesReadV1 = "issues-read-v1" DefaultAudience = "gh-aw-enclave-github" CapabilityPrefix = "awf-egh1" EnvCapabilityKey = "MCP_GATEWAY_ENCLAVE_CAPABILITY_KEY" EnvPolicyJSON = "MCP_GATEWAY_ENCLAVE_POLICY_JSON" OperationIssueCommentsList = "issues.comments.list" OperationIssuesGet = "issues.get" OperationIssuesList = "issues.list" MaxCapabilityTTLSeconds = 600 )
Variables ¶
This section is empty.
Functions ¶
func NormalizeRepository ¶
NormalizeRepository returns a canonical lowercase owner/name repository.
Types ¶
type Claims ¶
type Claims struct {
Version int `json:"v"`
Audience string `json:"aud"`
Run string `json:"run"`
Invocation string `json:"inv"`
Repo string `json:"repo"`
Profile string `json:"profile"`
Operations []string `json:"ops"`
NotBefore int64 `json:"nbf"`
Expires int64 `json:"exp"`
}
Claims is the invocation-bound capability payload minted by AWF.
func (*Claims) AllowsOperation ¶
AllowsOperation reports whether the invocation capability permits operation.
type Policy ¶
type Policy struct {
Version int `json:"version"`
Profile string `json:"profile"`
Audience string `json:"audience"`
WorkflowRunID string `json:"workflow_run_id"`
Repositories []RepositoryPolicy `json:"repositories"`
PublicMinIntegrity string `json:"public_min_integrity"`
AllowedOperations []string `json:"allowed_operations"`
MaxCapabilityTTLSeconds int64 `json:"max_capability_ttl_seconds"`
}
Policy is the compiler-owned authorization contract for one workflow run.
func ParsePolicy ¶
ParsePolicy parses and validates a compiler-generated enclave policy.
func (*Policy) AllowsOperation ¶
AllowsOperation reports whether operation is enabled by the compiler policy.
func (*Policy) GuardPolicyJSON ¶
GuardPolicyJSON returns the internal allow-only policy for this enclave profile.
func (*Policy) GuardRepos ¶
GuardRepos returns exact assigned repositories followed by the public catch-all.
func (*Policy) HasRepository ¶
HasRepository reports whether repo is an assignable repository in the policy.
func (*Policy) RepositorySensitivity ¶
RepositorySensitivity returns the configured sensitivity for repo.
type RepositoryPolicy ¶
RepositoryPolicy identifies a repository assignable to an enclave invocation.
type Route ¶
Route is a validated issues-read-v1 REST request.
func MatchRoute ¶
MatchRoute matches only the versioned enclave issue-read REST surface.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier verifies HMAC-signed invocation capabilities against one workflow policy.
func NewVerifier ¶
NewVerifier creates a capability verifier from a 32-byte lowercase-hex root key.