Skip to content

Commit

Permalink
Add test-routes create-add-task-json to help with adding new tasks to…
Browse files Browse the repository at this point in the history
… test aggregators
  • Loading branch information
mendess committed Oct 11, 2024
1 parent 191a6c0 commit a9ac6db
Show file tree
Hide file tree
Showing 6 changed files with 495 additions and 69 deletions.
5 changes: 4 additions & 1 deletion crates/dapf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async-trait.workspace = true
chrono.workspace = true
clap = { workspace = true, features = ["env"] }
daphne = { path = "../daphne", features = ["report-generator", "prometheus"] }
daphne-service-utils = { path = "../daphne-service-utils" }
daphne-service-utils = { path = "../daphne-service-utils", features = ["test-utils"] }
deepsize.workspace = true
futures.workspace = true
hex.workspace = true
Expand All @@ -39,3 +39,6 @@ tracing.workspace = true
url.workspace = true
webpki.workspace = true
x509-parser.workspace = true

[features]
experimental = ["daphne/experimental"]
52 changes: 50 additions & 2 deletions crates/dapf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ tool replace all instances of `dapf` with `cargo run --bin dapf`.
### Generate an hpke config

With the default algorithm:
```
```sh
dapf hpke generate
```

With a specific algorithm:
```
```sh
dapf hpke generate x25519_hkdf_sha256
```

Expand All @@ -46,6 +46,54 @@ used when issuing requests to `internal/test/add_task`:
DAP and base64 encoded hpke config: mwAgAAEAAQAgpj3X5rv8aNVOiyXjnOuCbN9RAVkqAmWQy5NddU5PIQ0
```

### Generating the requert payload for `internal/test/add_task`

Using `dapf test-routes create-add-task-json` the json used for adding a new
testing task can be easily created.

All the parameters of this task can be passed through commandline options, the
parameters that aren't passed in are then asked interactively.

```sh
Options:
--task-id <TASK_ID>
--leader-url <LEADER_URL>
--helper-url <HELPER_URL>
--vdaf <VDAF>
--leader-auth-token <LEADER_AUTH_TOKEN>
--collector-authentication-token <COLLECTOR_AUTHENTICATION_TOKEN>
--role <ROLE>
--query <QUERY>
--min-batch-size <MIN_BATCH_SIZE>
--collector-hpke-config <COLLECTOR_HPKE_CONFIG>
--time-precision <TIME_PRECISION>
--expires-in-seconds <EXPIRES_IN_SECONDS>
```

Using this command should output something like this, which you can then use to
issue requests to `internal/test/add_task`
```json
{
"task_id": "QXI0XDeCY06OtcHMWxwEyuLwe-MzUWQvBTlFXNl-H4U",
"leader": "http://leader/",
"helper": "http://helper/",
"vdaf": {
"type": "Prio3SumVecField64MultiproofHmacSha256Aes128",
"bits": "1",
"length": "100000",
"chunk_length": "320"
},
"leader_authentication_token": "I-am-the-leader",
"role": "helper",
"vdaf_verify_key": "dJXXtUfRAdIJ7z87revcZpqXZ16nbF9HB9OyZ1CMHxM",
"query_type": 2,
"min_batch_size": 10,
"time_precision": 3600,
"collector_hpke_config": "gwAgAAEAAQAgPMw62iLcCzNn0DHqSwKHanelnvMrWhwGEJVSpRpzmhM",
"task_expiration": 1729263391
}
```

### Decoding responses from aggregators


Expand Down
Loading

0 comments on commit a9ac6db

Please sign in to comment.