| 51 | } |
| 52 | |
| 53 | absl::optional<Value> CheckForMarkedAttributes(const AttributeTrail& trail, |
| 54 | ExecutionFrameBase& frame) { |
| 55 | if (frame.unknown_processing_enabled() && |
| 56 | frame.attribute_utility().CheckForUnknownExact(trail)) { |
| 57 | return frame.attribute_utility().CreateUnknownSet(trail.attribute()); |
| 58 | } |
| 59 | |
| 60 | if (frame.missing_attribute_errors_enabled() && |
| 61 | frame.attribute_utility().CheckForMissingAttribute(trail)) { |
| 62 | auto result = frame.attribute_utility().CreateMissingAttributeError( |
| 63 | trail.attribute()); |
| 64 | |
| 65 | if (result.ok()) { |
| 66 | return std::move(result).value(); |
| 67 | } |
| 68 | // Invariant broken (an invalid CEL Attribute shouldn't match anything). |
| 69 | // Log and return a CelError. |
| 70 | ABSL_LOG(ERROR) << "Invalid attribute pattern matched select path: " |
| 71 | << result.status().ToString(); // NOLINT: OSS compatibility |
| 72 | return cel::ErrorValue(std::move(result).status()); |
| 73 | } |
| 74 | |
| 75 | return absl::nullopt; |
| 76 | } |
| 77 | |
| 78 | void TestOnlySelect(const StructValue& msg, const std::string& field, |
| 79 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
no test coverage detected