CELLibrary produces options that expose this matcher for use in CEL expression matchers. Example: expression vars({'{magic_number}': ['3', '5']}) expression vars({'{foo}': 'single_value'})
(_ caddy.Context)
| 229 | // expression vars({'{magic_number}': ['3', '5']}) |
| 230 | // expression vars({'{foo}': 'single_value'}) |
| 231 | func (VarsMatcher) CELLibrary(_ caddy.Context) (cel.Library, error) { |
| 232 | return CELMatcherImpl( |
| 233 | "vars", |
| 234 | "vars_matcher_request_map", |
| 235 | []*cel.Type{CELTypeJSON}, |
| 236 | func(data ref.Val) (RequestMatcherWithError, error) { |
| 237 | mapStrListStr, err := CELValueToMapStrList(data) |
| 238 | if err != nil { |
| 239 | return nil, err |
| 240 | } |
| 241 | return VarsMatcher(mapStrListStr), nil |
| 242 | }, |
| 243 | ) |
| 244 | } |
| 245 | |
| 246 | // MatchVarsRE matches the value of the context variables by a given regular expression. |
| 247 | // |
nothing calls this directly
no test coverage detected