Skip to content

Add multi-file usage examples for lookup, key rotation, and audit#487

Open
albonec wants to merge 4 commits into
facebook:mainfrom
albonec:add-usage-examples-367
Open

Add multi-file usage examples for lookup, key rotation, and audit#487
albonec wants to merge 4 commits into
facebook:mainfrom
albonec:add-usage-examples-367

Conversation

@albonec
Copy link
Copy Markdown

@albonec albonec commented May 25, 2026

Closes #367

Adds three new subcommands to the akd-examples binary, each as a multi-file module following the same pattern as the existing fixture_generator and mysql_demo examples:

  • basic-lookup – publish a user pool in a single epoch and verify a client lookup proof
  • key-rotation – simulate successive key rotations for one user and verify the complete history proof across all versions
  • append-only-audit – populate several epochs and verify append-only integrity as an independent auditor

Each example is split across focused sub-files (setup.rs, client.rs, proofs.rs, etc.) for readability, and each ships with a tests/ sub-module that exercises both WhatsAppV1Configuration and ExperimentalConfiguration via the test_config! macro. All 179 tests pass (cargo test -p examples).

Test plan

  • cargo build -p examples compiles cleanly
  • cargo test -p examples — all 179 tests pass
  • cargo run -p examples -- basic-lookup runs and prints a verified lookup
  • cargo run -p examples -- key-rotation runs and prints a verified history table
  • cargo run -p examples -- append-only-audit runs and prints a verified audit result
  • cargo run -p examples -- basic-lookup --users 10 --label judy@example.com works
  • cargo run -p examples -- key-rotation --rotations 10 works
  • cargo run -p examples -- append-only-audit --epochs 8 works

albonec added 3 commits May 24, 2026 19:50
Adds three new subcommands to the akd-examples binary:
  basic-lookup      — publish a user pool and verify a lookup proof
  key-rotation      — simulate key rotations and verify history proof
  append-only-audit — populate epochs and verify append-only integrity

Each example is structured as a multi-file module matching the
existing fixture_generator / mysql_demo pattern.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 25, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.31%. Comparing base (3ce5335) to head (d47f386).
⚠️ Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #487      +/-   ##
==========================================
+ Coverage   88.61%   89.31%   +0.70%     
==========================================
  Files          39       38       -1     
  Lines        9109     7442    -1667     
==========================================
- Hits         8072     6647    -1425     
+ Misses       1037      795     -242     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@albonec albonec force-pushed the add-usage-examples-367 branch from cf7160b to d47f386 Compare May 27, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding more examples for usage

2 participants