Skip to content

Commit 363cf37

Browse files
fix: Fix overly agressive metata collection (#1345)
* Fix overly agressive metata collection * clippy fix * fix typo
1 parent 4a63fa7 commit 363cf37

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

sdk/src/claim.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ use crate::{
3232
assertions::{
3333
self, c2pa_action,
3434
labels::{
35-
self, ACTIONS, ASSERTION_STORE, BMFF_HASH, CLAIM_THUMBNAIL, DATABOX_STORE,
36-
METADATA_LABEL_REGEX,
35+
self, ACTIONS, ASSERTION_METADATA, ASSERTION_STORE, BMFF_HASH, CLAIM_THUMBNAIL,
36+
DATABOX_STORE, METADATA_LABEL_REGEX,
3737
},
3838
Actions, AssertionMetadata, AssetType, BmffHash, BoxHash, DataBox, DataHash, Ingredient,
3939
Metadata, Relationship, V2_DEPRECATED_ACTIONS,
@@ -3319,10 +3319,16 @@ impl Claim {
33193319

33203320
///Returns list of metadata assertions
33213321
pub fn metadata_assertions(&self) -> Vec<&ClaimAssertion> {
3322-
self.assertion_store
3322+
let mut mda: Vec<&ClaimAssertion> = self
3323+
.assertion_store
33233324
.iter()
33243325
.filter(|x| METADATA_LABEL_REGEX.is_match(&x.label_raw()))
3325-
.collect()
3326+
.collect();
3327+
3328+
// we don't include c2pa.assertion.metadata
3329+
mda.retain(|a| a.label() != ASSERTION_METADATA);
3330+
3331+
mda
33263332
}
33273333

33283334
/// Return list of data hash assertions

0 commit comments

Comments
 (0)