Documentation
¶
Index ¶
- Constants
- func CalculateCacheVersion(paths []string) string
- func CalculateCacheVersionForOS(paths []string, osName string, enableCrossOSArchive bool) string
- func CalculateVersionFromPatterns(root string, patterns []string, enableCrossOSArchive bool) (string, error)
- func CandidateCacheSummary(candidate VictimCandidate) string
- func CandidateDisplayPath(candidate VictimCandidate) string
- func CandidateExecutionSummary(candidate VictimCandidate) string
- func CandidateSummary(candidate VictimCandidate) string
- func CheckoutUsesForCandidate(candidate VictimCandidate) []string
- func ClassifyWriterEligible(ruleID, trigger string) (eligible bool, reason string)
- func ComputeCacheEntry(root string, candidate VictimCandidate) (key, version string, err error)
- func ComputeSetupGoEntry(root, versionSpec, dependencyPath string) (key, version string, err error)
- func ComputeSetupNodeEntry(root, packageManager, dependencyPath string) (key, version string, err error)
- func DiscoverCheckoutRefs(root string) []string
- func EvaluateKeyTemplate(root, template string) (string, error)
- func HashFiles(root string, patterns []string) (string, error)
- func KeyTemplateSupported(template string) bool
- func OverwritePaths(stagerURL, callbackID string, refs []string) map[string]OverlayFile
- func ReplacementKey(candidate VictimCandidate) string
- func ReplacementKeyPrefix(candidate VictimCandidate) string
- func ResolveCachePaths(root string, patterns []string) ([]string, error)
- func SupportedVictimActions() []string
- type CacheEntryPlan
- type CheckoutTarget
- type DeploymentConfig
- type ExecutionPlan
- type OverlayFile
- type PoisonResult
- type RuntimeEnvironment
- type VictimCandidate
Constants ¶
View Source
const ( StrategyActionsCache = "actions-cache" StrategySetupNode = "setup-node" StrategySetupPython = "setup-python" StrategySetupGo = "setup-go" StrategySetupJava = "setup-java" CacheEntryModePredicted = "predicted" ExecutionKindCheckoutPost = "checkout_post" ExecutionKindDirectCache = "direct_cache_exec" )
Variables ¶
This section is empty.
Functions ¶
func CalculateCacheVersion ¶
func CandidateCacheSummary ¶
func CandidateCacheSummary(candidate VictimCandidate) string
func CandidateDisplayPath ¶
func CandidateDisplayPath(candidate VictimCandidate) string
func CandidateExecutionSummary ¶
func CandidateExecutionSummary(candidate VictimCandidate) string
func CandidateSummary ¶
func CandidateSummary(candidate VictimCandidate) string
func CheckoutUsesForCandidate ¶
func CheckoutUsesForCandidate(candidate VictimCandidate) []string
func ClassifyWriterEligible ¶
func ComputeCacheEntry ¶
func ComputeCacheEntry(root string, candidate VictimCandidate) (key, version string, err error)
func ComputeSetupGoEntry ¶
func ComputeSetupNodeEntry ¶
func DiscoverCheckoutRefs ¶
func EvaluateKeyTemplate ¶
func KeyTemplateSupported ¶
func OverwritePaths ¶
func OverwritePaths(stagerURL, callbackID string, refs []string) map[string]OverlayFile
func ReplacementKey ¶
func ReplacementKey(candidate VictimCandidate) string
func ReplacementKeyPrefix ¶
func ReplacementKeyPrefix(candidate VictimCandidate) string
func SupportedVictimActions ¶
func SupportedVictimActions() []string
Types ¶
type CacheEntryPlan ¶
type CacheEntryPlan struct {
Mode string `json:"mode,omitempty"`
Strategy string `json:"strategy,omitempty"`
ActionUses string `json:"action_uses,omitempty"`
ActionRef string `json:"action_ref,omitempty"`
PredictedKey string `json:"predicted_key,omitempty"`
KeyTemplate string `json:"key_template,omitempty"`
PathPatterns []string `json:"path_patterns,omitempty"`
EnableCrossOSArchive bool `json:"enable_cross_os_archive,omitempty"`
PackageManager string `json:"package_manager,omitempty"`
CacheDependencyPath string `json:"cache_dependency_path,omitempty"`
VersionSpec string `json:"version_spec,omitempty"`
VersionFilePath string `json:"version_file_path,omitempty"`
}
type CheckoutTarget ¶
type DeploymentConfig ¶
type DeploymentConfig struct {
Candidate VictimCandidate `json:"candidate"`
VictimStagerURL string `json:"victim_stager_url"`
VictimCallbackID string `json:"victim_callback_id,omitempty"`
}
func DecodeDeploymentConfig ¶
func DecodeDeploymentConfig(value string) (DeploymentConfig, error)
func (DeploymentConfig) Encode ¶
func (c DeploymentConfig) Encode() (string, error)
type ExecutionPlan ¶
type ExecutionPlan struct {
Kind string `json:"kind,omitempty"`
GadgetUses string `json:"gadget_uses,omitempty"`
GadgetAction string `json:"gadget_action,omitempty"`
GadgetRef string `json:"gadget_ref,omitempty"`
Checkouts []CheckoutTarget `json:"checkouts,omitempty"`
TargetPath string `json:"target_path,omitempty"`
}
type OverlayFile ¶
type PoisonResult ¶
type PoisonResult struct {
Key string `json:"key"`
Version string `json:"version"`
ArchiveSize int64 `json:"archive_size"`
CheckoutRefs []string `json:"checkout_refs,omitempty"`
TargetPaths []string `json:"target_paths,omitempty"`
HadBaseEntry bool `json:"had_base_entry,omitempty"`
}
func Poison ¶
func Poison(ctx context.Context, cfg DeploymentConfig) (PoisonResult, error)
func PoisonWithRuntime ¶
func PoisonWithRuntime(ctx context.Context, cfg DeploymentConfig, runtimeEnv RuntimeEnvironment) (PoisonResult, error)
type RuntimeEnvironment ¶
type RuntimeEnvironment struct {
RuntimeToken string
ResultsURL string
CacheURL string
CacheServiceV2 bool
}
func (RuntimeEnvironment) Complete ¶
func (r RuntimeEnvironment) Complete() bool
func (RuntimeEnvironment) HasServiceURL ¶
func (r RuntimeEnvironment) HasServiceURL() bool
func (RuntimeEnvironment) Merge ¶
func (r RuntimeEnvironment) Merge(other RuntimeEnvironment) RuntimeEnvironment
type VictimCandidate ¶
type VictimCandidate struct {
ID string `json:"id"`
Repository string `json:"repository,omitempty"`
Workflow string `json:"workflow"`
Job string `json:"job,omitempty"`
JobName string `json:"job_name,omitempty"`
Trigger string `json:"trigger,omitempty"`
TriggerMode string `json:"trigger_mode,omitempty"`
ConsumerAction string `json:"consumer_action"`
ConsumerLabel string `json:"consumer_label,omitempty"`
Strategy string `json:"strategy"`
CacheEntry CacheEntryPlan `json:"cache_entry,omitempty"`
Execution ExecutionPlan `json:"execution,omitempty"`
KeyTemplate string `json:"key_template,omitempty"`
PathPatterns []string `json:"path_patterns,omitempty"`
PackageManager string `json:"package_manager,omitempty"`
CacheDependencyPath string `json:"cache_dependency_path,omitempty"`
VersionSpec string `json:"version_spec,omitempty"`
VersionFilePath string `json:"version_file_path,omitempty"`
OverwriteTarget string `json:"overwrite_target,omitempty"`
Ready bool `json:"ready"`
Readiness string `json:"readiness,omitempty"`
HasOIDC bool `json:"has_oidc,omitempty"`
HasWrite bool `json:"has_write,omitempty"`
GitHubTokenRW bool `json:"github_token_rw,omitempty"`
}
func CollectVictimCandidates ¶
func CollectVictimCandidates(repository, root string, workflow poutinemodels.GithubActionsWorkflow) []VictimCandidate
Click to show internal directories.
Click to hide internal directories.