Commit 703ac39
authored
fix(verifier): make VerificationRequest fields optional (#722)
* fix(verifier): make VerificationRequest fields optional
the /verify handler rejected requests that omitted `attestation` and
`debug` with a 422, even though the README documents sending only
`quote` + `event_log` + `vm_config` (or only `attestation`). every
field is an `Option`, but without `#[serde(default)]` serde treats a
missing field as a parse error.
add `#[serde(default)]` to all fields so any documented subset
deserializes and missing fields default to `None`.
* test(verifier): cover optional VerificationRequest field combinations
add serde tests proving each documented request subset deserializes:
quote-only (no attestation), attestation-only, and empty object. these
fail with "missing field" without the #[serde(default)] fix.1 parent 7bf2b00 commit 703ac39
1 file changed
Lines changed: 43 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | | - | |
| 18 | + | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
84 | 87 | | |
85 | 88 | | |
86 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
0 commit comments