Skip to content

Commit c2ba5e3

Browse files
committed
mirror: convert CRLite v3 filters to v4
It's going to be some time (at least one ESR cycle) before the upstream Mozilla clubcard data in the default channel is encoded in v4 format. To aid ecosystem convergence on v4, re-encode the legacy filters before mirroring them. Repeated mirror runs should produce the same hashes for the same content, including when converting v3 to v4, so sort the coverage entries during conversion. Lastly, the existing CI mirror job maintains the legacy data and manifest format at the mirror root for clients that don't support v4. A new `--encoding` flag lets CI explicitly request the older v3 encoding for this part of the mirror.
1 parent 6f839ef commit c2ba5e3

4 files changed

Lines changed: 317 additions & 27 deletions

File tree

‎.github/workflows/mirror.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
- name: Generate backend files
3030
run: |
3131
mkdir -p tmp/revocation/ tmp/intermediates
32-
cargo run --locked --release --bin mozilla-crlite -- tmp/revocation/ production --manifest-comment="$GITHUB_REPOSITORY run $GITHUB_RUN_ID"
33-
# backwards compatible location & manifest
34-
cp tmp/revocation/* tmp/
32+
cargo run --locked --release --bin mozilla-crlite -- tmp/revocation/ production --encoding=v4 --manifest-comment="$GITHUB_REPOSITORY run $GITHUB_RUN_ID"
33+
# backwards compatible location, v3 filters, and manifest
34+
cargo run --locked --release --bin mozilla-crlite -- tmp/ production --encoding=v3 --manifest-comment="$GITHUB_REPOSITORY run $GITHUB_RUN_ID"
3535
jq '. + {filters: .files} | del(.files)' tmp/manifest.json > tmp/manifest.json.new
3636
mv tmp/manifest.json.new tmp/manifest.json
3737

‎Cargo.lock‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎upki-mirror/Cargo.toml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ repository.workspace = true
99
[dependencies]
1010
aws-lc-rs.workspace = true
1111
clap.workspace = true
12+
clubcard-crlite.workspace = true
1213
csv.workspace = true
1314
eyre.workspace = true
1415
hex.workspace = true
@@ -19,6 +20,12 @@ serde_json.workspace = true
1920
tokio.workspace = true
2021
upki = { path = "../upki" }
2122

23+
[dev-dependencies]
24+
base64.workspace = true
25+
clubcard.workspace = true
26+
clubcard-crlite = { workspace = true, features = ["builder"] }
27+
tempfile.workspace = true
28+
2229
[lints]
2330
workspace = true
2431

0 commit comments

Comments
 (0)