Documentation
¶
Index ¶
- Constants
- func HashToken(token []byte) string
- func ValidateClaimEndpoint(value string) error
- type Claim
- type ClaimRequest
- type Config
- type Delivery
- type Handler
- type Identity
- type Journal
- type Repository
- type Store
- func (s Store) Add(ctx context.Context, instance, pool, role string, token []byte) error
- func (s Store) Consume(ctx context.Context, instance string, token []byte, repository string) (Claim, error)
- func (s Store) Read(ctx context.Context) (Journal, error)
- func (s Store) Remove(ctx context.Context, instance string) error
- func (s Store) Verify(ctx context.Context, instance string, token []byte) (Claim, error)
Constants ¶
View Source
const ( SchemaVersion = 1 MaximumConfigSize = 256 * 1024 DefaultConfigPath = "/etc/gha-fleet/cache-broker.yaml" )
View Source
const ( ClaimPath = "/api/v1/cache/claim" HealthPath = "/healthz" )
View Source
const ( JournalSchemaVersion = 1 ClaimTokenBytes = 32 ClaimTTL = 15 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func ValidateClaimEndpoint ¶
Types ¶
type Claim ¶
type Claim struct {
InstanceName string `json:"instance_name"`
PoolName string `json:"pool_name"`
Role string `json:"role"`
TokenSHA256 string `json:"token_sha256"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
ClaimedRepository string `json:"claimed_repository,omitempty"`
ClaimedAt time.Time `json:"claimed_at,omitempty"`
}
type ClaimRequest ¶
type ClaimRequest struct {
InstanceName string `json:"instance_name"`
RunnerName string `json:"runner_name"`
Repository string `json:"repository"`
RepositoryID int64 `json:"repository_id,omitempty"`
WorkflowRunID int64 `json:"workflow_run_id,omitempty"`
RunAttempt int64 `json:"run_attempt,omitempty"`
JobName string `json:"job_name,omitempty"`
WorkflowRef string `json:"workflow_ref,omitempty"`
CommitSHA string `json:"commit_sha,omitempty"`
Token string `json:"claim_token"`
}
type Config ¶
type Config struct {
SchemaVersion int `yaml:"schema_version" json:"schema_version"`
ListenAddress string `yaml:"listen_address" json:"listen_address"`
Endpoint string `yaml:"endpoint" json:"endpoint"`
Region string `yaml:"region" json:"region"`
Bucket string `yaml:"bucket" json:"bucket"`
CAFile string `yaml:"ca_file" json:"ca_file"`
JournalFile string `yaml:"journal_file" json:"journal_file"`
JournalLock string `yaml:"journal_lock_file" json:"journal_lock_file"`
Repositories []Repository `yaml:"repositories" json:"repositories"`
}
type Delivery ¶
type Delivery struct {
SchemaVersion int `json:"schema_version"`
DeliveryID string `json:"delivery_id"`
Role string `json:"role"`
Mode string `json:"mode"`
Endpoint string `json:"endpoint"`
Region string `json:"region"`
Bucket string `json:"bucket"`
PrefixRoot string `json:"prefix_root"`
AccessKey string `json:"access_key"`
SecretKeyB64 string `json:"secret_key_b64"`
CAPEMB64 string `json:"ca_pem_b64"`
}
type Journal ¶
type Repository ¶
Click to show internal directories.
Click to hide internal directories.