Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateString ¶
ValidateString checks that expression is a string CEL program (for dynamic action values).
Types ¶
type Credential ¶
Credential is optional BYOK metadata for CEL (resolved before Open).
func CredentialFromSnapshot ¶
func CredentialFromSnapshot(snap *snapshot.Snapshot, providerType string, key snapshot.APIKey, overrideName string) Credential
CredentialFromSnapshot builds CEL credential metadata without opening the secret.
type Decision ¶
type Decision struct {
Allowed bool
DeniedBy string
CredentialName string
RequestHeaders map[string]string // outbound headers to merge onto provider request
MatchedAllowName string // short-circuit allow policy name, if any
}
Decision is the result of applying when/then policies in priority order.
type Evaluator ¶
type Evaluator struct {
// contains filtered or unexported fields
}
Evaluator compiles and runs when/then CEL policies.
func NewEvaluator ¶
NewEvaluator builds a shared CEL environment.
func (*Evaluator) Apply ¶
func (e *Evaluator) Apply(policies []snapshot.Policy, key snapshot.APIKey, req Request, cred Credential) (Decision, error)
Apply walks enabled policies by priority (desc). When Expression is true, runs each Then action in order:
- deny → stop, deny
- allow → stop, allow (short-circuit)
- set_header → set outbound header (later writes overwrite), continue
- use_credential → set credential name (later writes overwrite), continue
Default (no deny / no short-circuit allow): allow.
Click to show internal directories.
Click to hide internal directories.