| # Copyright 2026 Google LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # | |
| load("@rules_cc//cc:cc_library.bzl", "cc_library") | |
| load("@rules_cc//cc:cc_test.bzl", "cc_test") | |
| package(default_visibility = ["//visibility:public"]) | |
| cc_library( | |
| name = "parse_assertion", | |
| srcs = ["parse_assertion.cc"], | |
| hdrs = ["parse_assertion.h"], | |
| deps = [ | |
| "//cbor:parse", | |
| "//proto:actions_assertion_cbor_proto", | |
| "//proto:actions_assertion_cc_proto", | |
| "//proto:ai_disclosure_assertion_cbor_proto", | |
| "//proto:ai_disclosure_assertion_cc_proto", | |
| "//proto:assertion_cc_proto", | |
| "//proto:asset_reference_assertion_cbor_proto", | |
| "//proto:asset_reference_assertion_cc_proto", | |
| "//proto:asset_types_assertion_cbor_proto", | |
| "//proto:asset_types_assertion_cc_proto", | |
| "//proto:bmff_based_hash_assertion_cbor_proto", | |
| "//proto:bmff_based_hash_assertion_cc_proto", | |
| "//proto:boxes_hash_assertion_cbor_proto", | |
| "//proto:boxes_hash_assertion_cc_proto", | |
| "//proto:collection_data_hash_assertion_cbor_proto", | |
| "//proto:collection_data_hash_assertion_cc_proto", | |
| "//proto:data_hash_assertion_cbor_proto", | |
| "//proto:data_hash_assertion_cc_proto", | |
| "//proto:environmental_sustainability_assertion_cbor_proto", | |
| "//proto:environmental_sustainability_assertion_cc_proto", | |
| "//proto:hashed_uri_cc_proto", | |
| "//proto:ingredient_assertion_cbor_proto", | |
| "//proto:ingredient_assertion_cc_proto", | |
| "//proto:metadata_assertion_cc_proto", | |
| "//proto:multi_asset_hash_assertion_cbor_proto", | |
| "//proto:multi_asset_hash_assertion_cc_proto", | |
| "//proto:repository_receipt_assertion_cc_proto", | |
| "//proto:soft_binding_assertion_cbor_proto", | |
| "//proto:soft_binding_assertion_cc_proto", | |
| "//proto:thumbnail_assertion_cc_proto", | |
| "@abseil-cpp//absl/status", | |
| "@abseil-cpp//absl/status:status_macros", | |
| "@abseil-cpp//absl/strings:string_view", | |
| "@nlohmann_json//:json", | |
| "@protobuf//:struct_cc_proto", | |
| ], | |
| ) | |
| cc_test( | |
| name = "parse_assertion_test", | |
| srcs = ["parse_assertion_test.cc"], | |
| deps = [ | |
| ":parse_assertion", | |
| "//proto:actions_assertion_cc_proto", | |
| "//proto:ai_disclosure_assertion_cc_proto", | |
| "//proto:assertion_cc_proto", | |
| "//proto:asset_reference_assertion_cc_proto", | |
| "//proto:asset_types_assertion_cc_proto", | |
| "//proto:bmff_based_hash_assertion_cc_proto", | |
| "//proto:boxes_hash_assertion_cc_proto", | |
| "//proto:collection_data_hash_assertion_cc_proto", | |
| "//proto:data_hash_assertion_cc_proto", | |
| "//proto:environmental_sustainability_assertion_cc_proto", | |
| "//proto:ingredient_assertion_cc_proto", | |
| "//proto:repository_receipt_assertion_cc_proto", | |
| "//testing:cbor_utils", | |
| "//testing:proto_test_utils", | |
| "@abseil-cpp//absl/status", | |
| "@abseil-cpp//absl/status:status_matchers", | |
| "@abseil-cpp//absl/strings:string_view", | |
| "@googletest//:gtest_main", | |
| "@nlohmann_json//:json", | |
| "@protobuf//:struct_cc_proto", | |
| ], | |
| ) | |
| cc_library( | |
| name = "assertion_cbor_encoder", | |
| srcs = ["assertion_cbor_encoder.cc"], | |
| hdrs = ["assertion_cbor_encoder.h"], | |
| deps = [ | |
| "//cbor", | |
| "//proto:actions_assertion_cbor_proto", | |
| "//proto:actions_assertion_cc_proto", | |
| "//proto:assertion_cc_proto", | |
| "//proto:bmff_based_hash_assertion_cbor_proto", | |
| "//proto:bmff_based_hash_assertion_cc_proto", | |
| "//proto:boxes_hash_assertion_cbor_proto", | |
| "//proto:boxes_hash_assertion_cc_proto", | |
| "//proto:collection_data_hash_assertion_cbor_proto", | |
| "//proto:collection_data_hash_assertion_cc_proto", | |
| "//proto:data_hash_assertion_cbor_proto", | |
| "//proto:data_hash_assertion_cc_proto", | |
| "//proto:ingredient_assertion_cbor_proto", | |
| "//proto:ingredient_assertion_cc_proto", | |
| "//proto:multi_asset_hash_assertion_cbor_proto", | |
| "@abseil-cpp//absl/base:no_destructor", | |
| "@abseil-cpp//absl/status", | |
| "@abseil-cpp//absl/status:status_macros", | |
| "@abseil-cpp//absl/status:statusor", | |
| "@abseil-cpp//absl/strings:cord", | |
| ], | |
| ) | |
| cc_test( | |
| name = "assertion_cbor_encoder_test", | |
| srcs = ["assertion_cbor_encoder_test.cc"], | |
| deps = [ | |
| ":assertion_cbor_encoder", | |
| "//cbor", | |
| "//cbor:parse", | |
| "//proto:actions_assertion_cbor_proto", | |
| "//proto:actions_assertion_cc_proto", | |
| "//proto:assertion_cc_proto", | |
| "//proto:bmff_based_hash_assertion_cbor_proto", | |
| "//proto:bmff_based_hash_assertion_cc_proto", | |
| "//proto:boxes_hash_assertion_cbor_proto", | |
| "//proto:boxes_hash_assertion_cc_proto", | |
| "//proto:data_hash_assertion_cbor_proto", | |
| "//proto:data_hash_assertion_cc_proto", | |
| "//proto:ingredient_assertion_cbor_proto", | |
| "//proto:ingredient_assertion_cc_proto", | |
| "//testing:proto_test_utils", | |
| "@abseil-cpp//absl/status", | |
| "@abseil-cpp//absl/status:status_matchers", | |
| "@googletest//:gtest_main", | |
| ], | |
| ) | |
| cc_library( | |
| name = "hashed_uri_validator", | |
| srcs = ["hashed_uri_validator.cc"], | |
| hdrs = ["hashed_uri_validator.h"], | |
| deps = [ | |
| "//constants:status_codes", | |
| "//crypto:algorithms", | |
| "//crypto:hash", | |
| "//crypto/default:hasher", | |
| "//jumbf:uri", | |
| "//jumbf:utils", | |
| "//proto:hashed_uri_cc_proto", | |
| "//validator:tracker", | |
| "@abseil-cpp//absl/status:statusor", | |
| "@abseil-cpp//absl/strings:string_view", | |
| ], | |
| ) | |
| cc_test( | |
| name = "hashed_uri_validator_test", | |
| srcs = ["hashed_uri_validator_test.cc"], | |
| deps = [ | |
| ":hashed_uri_validator", | |
| "//constants:status_codes", | |
| "//crypto:algorithms", | |
| "//crypto:hash", | |
| "//jumbf:box", | |
| "//jumbf:uri", | |
| "//proto:hashed_uri_cc_proto", | |
| "//testing:jumbf_utils", | |
| "//testing:proto_test_utils", | |
| "//testing:test_validation_tracker", | |
| "@abseil-cpp//absl/log:check", | |
| "@abseil-cpp//absl/status:statusor", | |
| "@abseil-cpp//absl/strings", | |
| "@abseil-cpp//absl/strings:string_view", | |
| "@googletest//:gtest_main", | |
| ], | |
| ) | |
| cc_library( | |
| name = "references_validator", | |
| srcs = ["references_validator.cc"], | |
| hdrs = ["references_validator.h"], | |
| deps = [ | |
| ":assertion_parser", | |
| ":hashed_uri_validator", | |
| "//constants:labels", | |
| "//constants:status_codes", | |
| "//proto:actions_assertion_cc_proto", | |
| "//proto:assertion_cc_proto", | |
| "//proto:hashed_uri_cc_proto", | |
| "//proto:ingredient_assertion_cc_proto", | |
| "//validator:tracker", | |
| "@abseil-cpp//absl/log:die_if_null", | |
| "@abseil-cpp//absl/strings", | |
| "@abseil-cpp//absl/strings:string_view", | |
| ], | |
| ) | |
| cc_test( | |
| name = "references_validator_test", | |
| srcs = ["references_validator_test.cc"], | |
| deps = [ | |
| ":hashed_uri_validator", | |
| ":references_validator", | |
| "//crypto:hash", | |
| "//crypto/default:hasher", | |
| "//jumbf:box", | |
| "//jumbf:uri", | |
| "//proto:actions_assertion_cc_proto", | |
| "//proto:assertion_cc_proto", | |
| "//testing:jumbf_utils", | |
| "//testing:proto_test_utils", | |
| "//testing:test_validation_tracker", | |
| "@abseil-cpp//absl/log:check", | |
| "@abseil-cpp//absl/strings", | |
| "@abseil-cpp//absl/strings:str_format", | |
| "@abseil-cpp//absl/strings:string_view", | |
| "@abseil-cpp//absl/types:span", | |
| "@googletest//:gtest_main", | |
| ], | |
| ) | |
| cc_library( | |
| name = "assertion_parser", | |
| srcs = ["assertion_parser.cc"], | |
| hdrs = ["assertion_parser.h"], | |
| deps = [ | |
| ":parse_assertion", | |
| "//constants:labels", | |
| "//constants:status_codes", | |
| "//proto:assertion_cc_proto", | |
| "//validator:tracker", | |
| "@abseil-cpp//absl/log", | |
| "@abseil-cpp//absl/status", | |
| "@abseil-cpp//absl/strings", | |
| "@abseil-cpp//absl/strings:string_view", | |
| "@protobuf//:struct_cc_proto", | |
| ], | |
| ) | |
| cc_test( | |
| name = "assertion_parser_test", | |
| srcs = ["assertion_parser_test.cc"], | |
| deps = [ | |
| ":assertion_parser", | |
| "//constants:status_codes", | |
| "//proto:assertion_cc_proto", | |
| "//testing:cbor_utils", | |
| "//testing:jumbf_utils", | |
| "//testing:proto_test_utils", | |
| "//testing:test_validation_tracker", | |
| "//validator:tracker", | |
| "@abseil-cpp//absl/strings", | |
| "@abseil-cpp//absl/strings:string_view", | |
| "@googletest//:gtest_main", | |
| ], | |
| ) | |
| cc_library( | |
| name = "actions_assertion_validator", | |
| srcs = ["actions_assertion_validator.cc"], | |
| hdrs = ["actions_assertion_validator.h"], | |
| deps = [ | |
| "//constants:ingredient_relationships", | |
| "//constants:labels", | |
| "//constants:status_codes", | |
| "//proto:actions_assertion_cc_proto", | |
| "//proto:assertion_cc_proto", | |
| "//proto:hashed_uri_cc_proto", | |
| "//proto:ingredient_assertion_cc_proto", | |
| "//proto:manifest_cc_proto", | |
| "//validator:tracker", | |
| "@abseil-cpp//absl/container:flat_hash_map", | |
| "@abseil-cpp//absl/container:flat_hash_set", | |
| "@abseil-cpp//absl/strings", | |
| "@abseil-cpp//absl/strings:str_format", | |
| "@abseil-cpp//absl/strings:string_view", | |
| ], | |
| ) | |
| cc_test( | |
| name = "actions_assertion_validator_test", | |
| srcs = ["actions_assertion_validator_test.cc"], | |
| deps = [ | |
| ":actions_assertion_validator", | |
| "//constants:status_codes", | |
| "//proto:manifest_cc_proto", | |
| "//testing:proto_test_utils", | |
| "//testing:test_validation_tracker", | |
| "@abseil-cpp//absl/strings:str_format", | |
| "@abseil-cpp//absl/strings:string_view", | |
| "@googletest//:gtest_main", | |
| ], | |
| ) | |
| cc_library( | |
| name = "assertion_referencer", | |
| srcs = ["assertion_referencer.cc"], | |
| hdrs = ["assertion_referencer.h"], | |
| deps = [ | |
| "//crypto:hash", | |
| "//jumbf:box_builder", | |
| "//jumbf:utils", | |
| "//proto:assertion_cc_proto", | |
| "//proto:hashed_uri_cc_proto", | |
| "@abseil-cpp//absl/log:die_if_null", | |
| "@abseil-cpp//absl/status", | |
| "@abseil-cpp//absl/status:status_macros", | |
| "@abseil-cpp//absl/status:statusor", | |
| "@abseil-cpp//absl/strings", | |
| "@abseil-cpp//absl/strings:cord", | |
| ], | |
| ) | |
| cc_test( | |
| name = "assertion_referencer_test", | |
| srcs = ["assertion_referencer_test.cc"], | |
| deps = [ | |
| ":assertion_referencer", | |
| "//crypto:mock_hash", | |
| "//jumbf:box_builder", | |
| "//jumbf:constants", | |
| "//jumbf:test_utils", | |
| "//proto:assertion_cc_proto", | |
| "//proto:hashed_uri_cc_proto", | |
| "//testing:proto_test_utils", | |
| "@abseil-cpp//absl/log:check", | |
| "@abseil-cpp//absl/status", | |
| "@abseil-cpp//absl/status:status_macros", | |
| "@abseil-cpp//absl/status:status_matchers", | |
| "@abseil-cpp//absl/strings", | |
| "@googletest//:gtest_main", | |
| ], | |
| ) | |
| cc_library( | |
| name = "validator", | |
| srcs = ["validator.cc"], | |
| hdrs = ["validator.h"], | |
| deps = [ | |
| ":actions_assertion_validator", | |
| ":assertion_parser", | |
| ":hashed_uri_validator", | |
| ":references_validator", | |
| "//constants:ingredient_relationships", | |
| "//constants:labels", | |
| "//constants:status_codes", | |
| "//jumbf:box", | |
| "//jumbf:uri", | |
| "//proto:actions_assertion_cc_proto", | |
| "//proto:assertion_cc_proto", | |
| "//proto:generator_info_cc_proto", | |
| "//proto:hashed_uri_cc_proto", | |
| "//proto:ingredient_assertion_cc_proto", | |
| "//proto:manifest_cc_proto", | |
| "//validator:tracker", | |
| "@abseil-cpp//absl/base:no_destructor", | |
| "@abseil-cpp//absl/container:flat_hash_map", | |
| "@abseil-cpp//absl/container:flat_hash_set", | |
| "@abseil-cpp//absl/log", | |
| "@abseil-cpp//absl/status:statusor", | |
| "@abseil-cpp//absl/strings", | |
| "@abseil-cpp//absl/strings:string_view", | |
| "@protobuf//:protobuf_lite", | |
| ], | |
| ) | |
| cc_test( | |
| name = "validator_test", | |
| srcs = ["validator_test.cc"], | |
| deps = [ | |
| ":validator", | |
| "//constants:status_codes", | |
| "//jumbf:box", | |
| "//jumbf:uri", | |
| "//proto:assertion_cc_proto", | |
| "//proto:hashed_uri_cc_proto", | |
| "//proto:manifest_cc_proto", | |
| "//testing:cbor_utils", | |
| "//testing:jumbf_utils", | |
| "//testing:proto_test_utils", | |
| "//testing:test_validation_tracker", | |
| "@abseil-cpp//absl/strings", | |
| "@abseil-cpp//absl/strings:string_view", | |
| "@abseil-cpp//absl/types:span", | |
| "@googletest//:gtest_main", | |
| ], | |
| ) |