| 347 | } |
| 348 | |
| 349 | cel::Value containsAddress(const cel::OpaqueValue& matcher, |
| 350 | const cel::OpaqueValue& addr) { |
| 351 | const auto* matcher_rep = NetworkAddressMatcher::Unwrap(matcher); |
| 352 | auto addr_rep = NetworkAddressRep::Unwrap(addr); |
| 353 | if (matcher_rep == nullptr || !addr_rep.has_value()) { |
| 354 | // dispatcher should catch this, but right now only distiguishes at the |
| 355 | // kind level. |
| 356 | return cel::ErrorValue(absl::InvalidArgumentError("no matching overload")); |
| 357 | } |
| 358 | return cel::BoolValue(matcher_rep->Match(*addr_rep)); |
| 359 | } |
| 360 | |
| 361 | } // namespace |
| 362 |
nothing calls this directly
no test coverage detected