Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mapper ¶
type Mapper struct {
CompiledMappingRules []compiledMappingRule
}
Mapper is a collection of compiledMappingRules.
func NewMapper ¶
func NewMapper(rules []MappingRule) (*Mapper, error)
type MappingRule ¶
type MappingRule struct {
// required indicates that if the rule fails to produce a value the rule
// will be skipped. Otherwise the execution should fail.
// +kubebuilder:validation:Optional
// +kubebuilder:default:=false
Required bool `json:"required"`
// sourceExpression is CEL program to compute a transformation of input into
// a new form.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=2
// +kubebuilder:example:=`self.oidc.groups.filter(g, g.startsWith('app_')).join(',')`
SourceExpression string `json:"sourceExpression"`
// targetPropPath is a dot-separated property path for where the result
// should be attached in the output.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=2
// +kubebuilder:example:=`auth.internal_groups`
TargetPropPath string `json:"targetPropPath"`
}
MappingRule defines a transformation rule for mapping arbitrary data from an input to an output.
Click to show internal directories.
Click to hide internal directories.