Documentation
¶
Index ¶
- Constants
- func Empty[T any]() T
- func EmptyStringToNil(a string) *string
- func FromEmptyPtr[T any](v *T) *T
- func FromPtr[T any](v *T) T
- func GetAccountIDFromContext(ctx context.Context) string
- func MapAdapterToConditionType(adapterName string) string
- func MaskSensitiveFields(data map[string]interface{}) map[string]interface{}
- func NewConditionMappingEnvironment() (*cel.Env, error)
- func NilToEmptyString(a *string) string
- func PtrString(v string) *string
- func ToPtr[T any](v T) *T
Constants ¶
const ( CELVarStatuses = "statuses" // Array of adapter statuses CELVarResource = "resource" // Full cluster/nodepool object )
CEL context variable names These constants ensure consistency between environment declaration and activation map
const CELCostLimit = 10000
CELCostLimit is the maximum cost allowed for CEL expression evaluation. Prevents CPU spikes from misconfigured or pathological expressions. Used by both runtime evaluation and startup validation.
const RedactedPlaceholder = "***REDACTED***"
RedactedPlaceholder is the string used to replace sensitive field values
Variables ¶
This section is empty.
Functions ¶
func EmptyStringToNil ¶
func FromEmptyPtr ¶
func FromEmptyPtr[T any](v *T) *T
FromEmptyPtr emulates ToPtr(FromPtr(x)) sequence
func GetAccountIDFromContext ¶
func MapAdapterToConditionType ¶ added in v0.3.1
MapAdapterToConditionType converts an adapter name to a semantic condition type (PascalCase + "Successful" suffix). Used to derive the type name for per-adapter conditions mirrored into resource status (e.g. "adapter1" → "Adapter1Successful", "my-adapter" → "MyAdapterSuccessful").
func MaskSensitiveFields ¶ added in v0.3.1
MaskSensitiveFields redacts adapter data keys matching sensitive patterns before exposing to CEL evaluation context. This prevents accidental leakage of credentials in public API condition messages/reasons.
Keys are checked case-insensitively against sensitivePatterns. Redacted values are replaced with RedactedPlaceholder.
Recursion is limited to maxMaskingDepth to prevent stack overflow (SEC-03).
Examples:
- "adminPassword" → redacted (contains "password")
- "pullSecret" → redacted (contains "secret")
- "gcpServiceAccountKey" → redacted (contains "accountkey")
- "clusterName" → NOT redacted (no sensitive pattern match)
func NewConditionMappingEnvironment ¶ added in v0.3.1
NewConditionMappingEnvironment creates a CEL environment for condition mapping with context variables and custom functions. This environment is used both for validation (at config load time) and runtime evaluation.
func NilToEmptyString ¶
Types ¶
This section is empty.