Commit 4f300ea
committed
examples(cognitive-attestation-governed): address automated review feedback
Incorporates the actionable items from the code-reviewer and
security-scanner bot reviews on this PR. Six fixes:
1. Add 'timestamp' field to the envelope and bind it into the canonical
form. Replay defence: a reused envelope still carries its original
timestamp, which a verifier can reject against a freshness policy.
2. Clarify tamper-detection output wording — 'PASS (tampering detected,
envelope rejected)' and 'FAIL (tampering not detected, envelope
accepted)'. No ambiguity about which outcome is desirable.
3. Expand the policy-evaluator docstring to state unambiguously that it
is a minimal placeholder, not a substitute for the AGT policy engine.
4. Add a prominent note above the minimal JCS implementation flagging
that it is NOT a full RFC 8785 implementation and pointing at
spec-conformant libraries (jcs on PyPI, the APS SDK reference impl).
5. Add a 'Security notes' section to the README covering: key management
(OS keychain, Vault, HSM options), the JCS-minimal disclaimer, and
the policy-placeholder disclaimer.
6. Document the feature-activation sort order rationale ('feature_id,
activation_statistic' is required by the spec for cross-impl
reproducibility) and cite the exact spec section.
No em dashes. Both verification and tamper-rejection still PASS.
Kept it deliberately self-contained; did not introduce Pydantic or
pytest dependencies for a single-file example.1 parent 11ada54 commit 4f300ea
2 files changed
Lines changed: 53 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
63 | 72 | | |
64 | 73 | | |
65 | 74 | | |
66 | | - | |
| 75 | + | |
67 | 76 | | |
68 | | - | |
| 77 | + | |
69 | 78 | | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| 84 | + | |
75 | 85 | | |
Lines changed: 37 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
| |||
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
| 101 | + | |
91 | 102 | | |
92 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
93 | 111 | | |
94 | 112 | | |
95 | 113 | | |
96 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
97 | 118 | | |
98 | 119 | | |
99 | 120 | | |
100 | 121 | | |
101 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
102 | 126 | | |
103 | 127 | | |
104 | 128 | | |
| |||
112 | 136 | | |
113 | 137 | | |
114 | 138 | | |
| 139 | + | |
115 | 140 | | |
116 | 141 | | |
117 | 142 | | |
| |||
156 | 181 | | |
157 | 182 | | |
158 | 183 | | |
159 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
160 | 193 | | |
161 | 194 | | |
162 | 195 | | |
| |||
256 | 289 | | |
257 | 290 | | |
258 | 291 | | |
259 | | - | |
| 292 | + | |
260 | 293 | | |
261 | 294 | | |
262 | 295 | | |
| |||
0 commit comments