teef 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. {teef-0.1.2 → teef-0.1.3}/PKG-INFO +4 -4
  2. {teef-0.1.2 → teef-0.1.3}/README.md +3 -3
  3. {teef-0.1.2 → teef-0.1.3}/src/teef/__init__.py +1 -1
  4. {teef-0.1.2 → teef-0.1.3}/src/teef/catalog.py +2 -2
  5. {teef-0.1.2 → teef-0.1.3}/src/teef/recipient.py +6 -11
  6. {teef-0.1.2 → teef-0.1.3}/src/teef/report.py +1 -1
  7. {teef-0.1.2 → teef-0.1.3}/src/teef/rules.py +1 -1
  8. {teef-0.1.2 → teef-0.1.3}/tests/test_recipient_basic.py +7 -6
  9. {teef-0.1.2 → teef-0.1.3}/tests/test_rules.py +6 -1
  10. {teef-0.1.2 → teef-0.1.3}/.gitattributes +0 -0
  11. {teef-0.1.2 → teef-0.1.3}/.github/workflows/publish.yml +0 -0
  12. {teef-0.1.2 → teef-0.1.3}/.gitignore +0 -0
  13. {teef-0.1.2 → teef-0.1.3}/.python-version +0 -0
  14. {teef-0.1.2 → teef-0.1.3}/LICENSE +0 -0
  15. {teef-0.1.2 → teef-0.1.3}/pyproject.toml +0 -0
  16. {teef-0.1.2 → teef-0.1.3}/src/teef/__main__.py +0 -0
  17. {teef-0.1.2 → teef-0.1.3}/src/teef/cli.py +0 -0
  18. {teef-0.1.2 → teef-0.1.3}/src/teef/context.py +0 -0
  19. {teef-0.1.2 → teef-0.1.3}/src/teef/errors.py +0 -0
  20. {teef-0.1.2 → teef-0.1.3}/src/teef/findings.py +0 -0
  21. {teef-0.1.2 → teef-0.1.3}/src/teef/jose.py +0 -0
  22. {teef-0.1.2 → teef-0.1.3}/src/teef/keys.py +0 -0
  23. {teef-0.1.2 → teef-0.1.3}/src/teef/models.py +0 -0
  24. {teef-0.1.2 → teef-0.1.3}/src/teef/package.py +0 -0
  25. {teef-0.1.2 → teef-0.1.3}/src/teef/parsing.py +0 -0
  26. {teef-0.1.2 → teef-0.1.3}/src/teef/py.typed +0 -0
  27. {teef-0.1.2 → teef-0.1.3}/src/teef/reader.py +0 -0
  28. {teef-0.1.2 → teef-0.1.3}/src/teef/schema.py +0 -0
  29. {teef-0.1.2 → teef-0.1.3}/src/teef/schemas/tprm-evidence-exchange-0.1.0.schema.json +0 -0
  30. {teef-0.1.2 → teef-0.1.3}/src/teef/serialize.py +0 -0
  31. {teef-0.1.2 → teef-0.1.3}/src/teef/sources.py +0 -0
  32. {teef-0.1.2 → teef-0.1.3}/src/teef/templates/report.css +0 -0
  33. {teef-0.1.2 → teef-0.1.3}/src/teef/templates/report.html.j2 +0 -0
  34. {teef-0.1.2 → teef-0.1.3}/tests/conftest.py +0 -0
  35. {teef-0.1.2 → teef-0.1.3}/tests/test_cli.py +0 -0
  36. {teef-0.1.2 → teef-0.1.3}/tests/test_cli_sig.py +0 -0
  37. {teef-0.1.2 → teef-0.1.3}/tests/test_conformance_full.py +0 -0
  38. {teef-0.1.2 → teef-0.1.3}/tests/test_context_catalog.py +0 -0
  39. {teef-0.1.2 → teef-0.1.3}/tests/test_keys.py +0 -0
  40. {teef-0.1.2 → teef-0.1.3}/tests/test_models_basic.py +0 -0
  41. {teef-0.1.2 → teef-0.1.3}/tests/test_models_full.py +0 -0
  42. {teef-0.1.2 → teef-0.1.3}/tests/test_models_spec.py +0 -0
  43. {teef-0.1.2 → teef-0.1.3}/tests/test_package.py +0 -0
  44. {teef-0.1.2 → teef-0.1.3}/tests/test_package_sig.py +0 -0
  45. {teef-0.1.2 → teef-0.1.3}/tests/test_parsing.py +0 -0
  46. {teef-0.1.2 → teef-0.1.3}/tests/test_public_api.py +0 -0
  47. {teef-0.1.2 → teef-0.1.3}/tests/test_reader.py +0 -0
  48. {teef-0.1.2 → teef-0.1.3}/tests/test_reader_jwe.py +0 -0
  49. {teef-0.1.2 → teef-0.1.3}/tests/test_reader_sig.py +0 -0
  50. {teef-0.1.2 → teef-0.1.3}/tests/test_recipient_review.py +0 -0
  51. {teef-0.1.2 → teef-0.1.3}/tests/test_report_model.py +0 -0
  52. {teef-0.1.2 → teef-0.1.3}/tests/test_report_render.py +0 -0
  53. {teef-0.1.2 → teef-0.1.3}/tests/test_review_fixes.py +0 -0
  54. {teef-0.1.2 → teef-0.1.3}/tests/test_rules_conformance.py +0 -0
  55. {teef-0.1.2 → teef-0.1.3}/tests/test_scaffold.py +0 -0
  56. {teef-0.1.2 → teef-0.1.3}/tests/test_schema.py +0 -0
  57. {teef-0.1.2 → teef-0.1.3}/tests/test_serialize.py +0 -0
  58. {teef-0.1.2 → teef-0.1.3}/tests/test_sources_folder.py +0 -0
  59. {teef-0.1.2 → teef-0.1.3}/tests/test_sources_zip.py +0 -0
  60. {teef-0.1.2 → teef-0.1.3}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: teef
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Build, verify and read TEEF (TPRM Evidence Exchange Format) packages
5
5
  Project-URL: Source, https://github.com/stalpers/pyTEEF
6
6
  Project-URL: Issues, https://github.com/stalpers/pyTEEF/issues
@@ -126,7 +126,7 @@ Mistakes in a single object, such as an `answered` response without an answer or
126
126
  | TEEF-AR-02, 03 | Type 1 reports cover one date, type 2 reports cover more than one |
127
127
  | TEEF-EV-11 | Every declared file is present and matches its digest |
128
128
  | TEEF-ARC-01, 03, 06 | No undeclared files, reserved device names, or case-insensitive path collisions |
129
- | TEEF-SIG-03 to 08, 11, 12, 13 | Signing, encryption and signature checks, see "Sign and encrypt" |
129
+ | TEEF-SIG-03 to 08, 11, 12, 13 | Signing, encryption and signature checks, see "Sign and encrypt". Trusted timestamps (TEEF-SIG-09, 10) are withdrawn from the spec, so a `manifest.tst` is rejected as an undeclared file |
130
130
 
131
131
  `write_dir` and `write_zip` raise `PackageValidationError` with the findings when any rule is broken, and write nothing. `teef.check_package(manifest_dict, files)` runs the same checks on any manifest.
132
132
 
@@ -204,9 +204,9 @@ Besides every check above, reading adds:
204
204
  | TEEF-EV-10 | Evidence without a stated scope |
205
205
  | TEEF-ANS-12 | A questionnaire or version you did not list as known |
206
206
  | TEEF-URI-06 | An external link that appears to carry credentials |
207
- | TEEF-SIG-12 | An invalid signature is an error. A signature or timestamp that teef did not verify (no trusted keys, or timestamps) is a warning |
207
+ | TEEF-SIG-12 | An invalid signature is an error. A signature that teef could not verify because no trusted keys were given is a warning |
208
208
 
209
- Not covered yet: timestamps (TEEF-SIG-09, 10), keys held in a KMS or HSM, and checks against questionnaire definitions (TEEF-ANS-11, 14).
209
+ Not covered yet: keys held in a KMS or HSM, and checks against questionnaire definitions (TEEF-ANS-11, 14).
210
210
 
211
211
  ## Sign and encrypt
212
212
 
@@ -98,7 +98,7 @@ Mistakes in a single object, such as an `answered` response without an answer or
98
98
  | TEEF-AR-02, 03 | Type 1 reports cover one date, type 2 reports cover more than one |
99
99
  | TEEF-EV-11 | Every declared file is present and matches its digest |
100
100
  | TEEF-ARC-01, 03, 06 | No undeclared files, reserved device names, or case-insensitive path collisions |
101
- | TEEF-SIG-03 to 08, 11, 12, 13 | Signing, encryption and signature checks, see "Sign and encrypt" |
101
+ | TEEF-SIG-03 to 08, 11, 12, 13 | Signing, encryption and signature checks, see "Sign and encrypt". Trusted timestamps (TEEF-SIG-09, 10) are withdrawn from the spec, so a `manifest.tst` is rejected as an undeclared file |
102
102
 
103
103
  `write_dir` and `write_zip` raise `PackageValidationError` with the findings when any rule is broken, and write nothing. `teef.check_package(manifest_dict, files)` runs the same checks on any manifest.
104
104
 
@@ -176,9 +176,9 @@ Besides every check above, reading adds:
176
176
  | TEEF-EV-10 | Evidence without a stated scope |
177
177
  | TEEF-ANS-12 | A questionnaire or version you did not list as known |
178
178
  | TEEF-URI-06 | An external link that appears to carry credentials |
179
- | TEEF-SIG-12 | An invalid signature is an error. A signature or timestamp that teef did not verify (no trusted keys, or timestamps) is a warning |
179
+ | TEEF-SIG-12 | An invalid signature is an error. A signature that teef could not verify because no trusted keys were given is a warning |
180
180
 
181
- Not covered yet: timestamps (TEEF-SIG-09, 10), keys held in a KMS or HSM, and checks against questionnaire definitions (TEEF-ANS-11, 14).
181
+ Not covered yet: keys held in a KMS or HSM, and checks against questionnaire definitions (TEEF-ANS-11, 14).
182
182
 
183
183
  ## Sign and encrypt
184
184
 
@@ -1,6 +1,6 @@
1
1
  """Build, verify and read TEEF (TPRM Evidence Exchange Format) packages."""
2
2
 
3
- __version__ = "0.1.2"
3
+ __version__ = "0.1.3"
4
4
 
5
5
  SCHEMA_VERSION = "0.1.0"
6
6
  """The TEEF schema version this package reads and writes."""
@@ -114,8 +114,8 @@ RULES: dict[str, str] = {
114
114
  "TEEF-SIG-06": "Detached JWS over the exact manifest bytes",
115
115
  "TEEF-SIG-07": "JWS header values",
116
116
  "TEEF-SIG-08": "Resolve the signing key through trusted configuration",
117
- "TEEF-SIG-09": "RFC 3161 token over the exact manifest bytes",
118
- "TEEF-SIG-10": "Verify the timestamp token",
117
+ "TEEF-SIG-09": "Withdrawn: trusted timestamp token",
118
+ "TEEF-SIG-10": "Withdrawn: verify the timestamp token",
119
119
  "TEEF-SIG-11": "Separate signing and encryption keys",
120
120
  "TEEF-SIG-12": "Reject invalid proofs",
121
121
  "TEEF-SIG-13": "Reject a package missing a required proof",
@@ -12,7 +12,7 @@ from urllib.parse import parse_qsl, urlsplit
12
12
 
13
13
  from .context import Context
14
14
  from .findings import Finding
15
- from .rules import SIGNATURE_FILES, _date, _dicts, _evidence
15
+ from .rules import _date, _dicts, _evidence
16
16
 
17
17
  RecipientCheck = Callable[[dict[str, Any], Mapping[str, bytes], Context], list[Finding]]
18
18
 
@@ -192,16 +192,11 @@ def check_missing_scope(
192
192
  def check_unverified_proofs(
193
193
  manifest: dict[str, Any], files: Mapping[str, bytes], context: Context
194
194
  ) -> list[Finding]:
195
- """TEEF-SIG-12: a timestamp, or a signature without trusted keys, that teef cannot verify."""
196
- unverified = SIGNATURE_FILES & set(files)
197
- if context.trusted_keys is not None:
198
- unverified -= {"manifest.jws"}
199
- messages = {
200
- "manifest.jws": "manifest.jws was not verified: no trusted keys were given"
201
- " (use --trusted-keys)",
202
- "manifest.tst": "manifest.tst is present but teef does not verify timestamps",
203
- }
204
- return [_warning("TEEF-SIG-12", messages[name], None) for name in sorted(unverified)]
195
+ """TEEF-SIG-12: a signature that teef cannot verify because no trusted keys were given."""
196
+ if "manifest.jws" not in files or context.trusted_keys is not None:
197
+ return []
198
+ message = "manifest.jws was not verified: no trusted keys were given (use --trusted-keys)"
199
+ return [_warning("TEEF-SIG-12", message, None)]
205
200
 
206
201
 
207
202
  # --- assurance reports and certificates ------------------------------------------
@@ -157,7 +157,7 @@ def _environment() -> Environment:
157
157
  )
158
158
 
159
159
 
160
- _SIDE_FILES = {"manifest.jws": "signature", "manifest.tst": "timestamp"}
160
+ _SIDE_FILES = {"manifest.jws": "signature"}
161
161
 
162
162
 
163
163
  def _source_name(result: ReadResult) -> str:
@@ -18,7 +18,7 @@ from .schema import check_schema
18
18
  Check = Callable[[dict[str, Any], Mapping[str, bytes]], list[Finding]]
19
19
 
20
20
  SUPPORTED_SCHEMA_VERSION = "0.1.0"
21
- SIGNATURE_FILES = frozenset({"manifest.jws", "manifest.tst"})
21
+ SIGNATURE_FILES = frozenset({"manifest.jws"})
22
22
  RESERVED_NAMES = frozenset(
23
23
  {"CON", "PRN", "AUX", "NUL"}
24
24
  | {f"COM{i}" for i in range(1, 10)}
@@ -129,13 +129,14 @@ def test_evidence_without_scope() -> None:
129
129
  assert "Policy (policy)" in result[0].message
130
130
 
131
131
 
132
- @pytest.mark.parametrize("name", ["manifest.jws", "manifest.tst"])
133
- def test_unverified_proof(name: str) -> None:
134
- result = findings(manifest(), files={name: b"x"})
132
+ def test_unverified_signature() -> None:
133
+ result = findings(manifest(), files={"manifest.jws": b"x"})
135
134
  assert [(f.rule_id, f.severity) for f in result] == [("TEEF-SIG-12", "warning")]
136
- assert "not verif" in result[0].message
137
- if name == "manifest.jws":
138
- assert "was not verified" in result[0].message
135
+ assert "was not verified" in result[0].message
136
+
137
+
138
+ def test_manifest_tst_gets_no_proof_warning() -> None:
139
+ assert findings(manifest(), files={"manifest.tst": b"x"}) == []
139
140
 
140
141
 
141
142
  def test_same_organization() -> None:
@@ -210,7 +210,12 @@ def test_undeclared_file() -> None:
210
210
 
211
211
 
212
212
  def test_manifest_jws_allowed() -> None:
213
- assert rule_ids(manifest(), {"manifest.jws": b"x", "manifest.tst": b"y"}) == set()
213
+ assert rule_ids(manifest(), {"manifest.jws": b"x"}) == set()
214
+
215
+
216
+ def test_manifest_tst_is_undeclared() -> None:
217
+ # Timestamps (TEEF-SIG-09, 10) are withdrawn, so manifest.tst is an undeclared file.
218
+ assert rule_ids(manifest(), {"manifest.tst": b"y"}) == {"TEEF-ARC-01"}
214
219
 
215
220
 
216
221
  @pytest.mark.parametrize("name", ["con", "nul.txt", "com1.json", "lpt9"])
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes