Skip to content

Commit 8932506

Browse files
committed
Update the default max number of assertions to 50
1 parent 4a12132 commit 8932506

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sdk/src/builder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5789,18 +5789,18 @@ mod tests {
57895789
fn test_add_assertion_limit() {
57905790
use crate::settings::Settings;
57915791

5792-
// Default limit is 100; verify the 100th assertion succeeds and the 101st is rejected.
5792+
// Default limit is 50; verify the 50th assertion succeeds and the 51st is rejected.
57935793
let mut builder = Builder::new();
57945794
let data = serde_json::json!({"value": 1});
5795-
for i in 0..100 {
5795+
for i in 0..50 {
57965796
builder
57975797
.add_assertion_json(format!("org.test.assertion.{i}"), &data)
57985798
.expect("should succeed within limit");
57995799
}
58005800
let err = builder
58015801
.add_assertion_json("org.test.assertion.overflow", &data)
5802-
.expect_err("101st assertion should be rejected");
5803-
assert!(matches!(err, Error::TooManyAssertions { max: 100 }));
5802+
.expect_err("51st assertion should be rejected");
5803+
assert!(matches!(err, Error::TooManyAssertions { max: 50 }));
58045804

58055805
// Verify the limit is configurable: set max_assertions=2 via settings.
58065806
let settings = Settings {

sdk/src/settings/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ pub struct BuilderSettings {
589589
/// of assertions. Calls to [`Builder::add_assertion`] or [`Builder::add_assertion_json`]
590590
/// that would exceed this limit return [`Error::TooManyAssertions`].
591591
///
592-
/// The default value is 100.
592+
/// The default value is 50.
593593
///
594594
/// [`Builder::add_assertion`]: crate::Builder::add_assertion
595595
/// [`Builder::add_assertion_json`]: crate::Builder::add_assertion_json
@@ -611,7 +611,7 @@ impl Default for BuilderSettings {
611611
prefer_box_hash: false,
612612
generate_c2pa_archive: Some(true),
613613
auto_timestamp_assertion: TimeStampSettings::default(),
614-
max_assertions: 100,
614+
max_assertions: 50,
615615
}
616616
}
617617
}

0 commit comments

Comments
 (0)