(metadata map[string]any)
| 129 | } |
| 130 | |
| 131 | func ParsePolicyVariables(metadata map[string]any) cel.EnvOption { |
| 132 | var variables []*decls.VariableDecl |
| 133 | for n, t := range metadata { |
| 134 | variables = append(variables, decls.NewVariable(n, parseCustomPolicyVariableType(t.(string)))) |
| 135 | } |
| 136 | return cel.VariableDecls(variables...) |
| 137 | } |
| 138 | |
| 139 | func parseCustomPolicyVariableType(t string) *types.Type { |
| 140 | switch t { |
nothing calls this directly
no test coverage detected