signedshot 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.
- {signedshot-0.1.2 → signedshot-0.1.3}/Cargo.lock +1 -1
- {signedshot-0.1.2 → signedshot-0.1.3}/Cargo.toml +1 -1
- {signedshot-0.1.2 → signedshot-0.1.3}/PKG-INFO +1 -1
- {signedshot-0.1.2 → signedshot-0.1.3}/pyproject.toml +1 -1
- {signedshot-0.1.2 → signedshot-0.1.3}/python/signedshot/__init__.py +3 -2
- {signedshot-0.1.2 → signedshot-0.1.3}/python/signedshot/__init__.pyi +27 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/.github/workflows/ci.yml +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/.github/workflows/release.yml +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/.gitignore +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/README.md +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/src/bin/signedshot.rs +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/src/error.rs +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/src/integrity.rs +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/src/jwt.rs +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/src/lib.rs +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/src/python.rs +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/src/sidecar.rs +0 -0
- {signedshot-0.1.2 → signedshot-0.1.3}/src/validate.rs +0 -0
|
@@ -3,7 +3,8 @@ from signedshot.signedshot import (
|
|
|
3
3
|
ValidationResult,
|
|
4
4
|
validate,
|
|
5
5
|
validate_files,
|
|
6
|
+
validate_with_jwks,
|
|
6
7
|
)
|
|
7
8
|
|
|
8
|
-
__all__ = ["ValidationResult", "validate", "validate_files"]
|
|
9
|
-
__version__ = "0.1.
|
|
9
|
+
__all__ = ["ValidationResult", "validate", "validate_files", "validate_with_jwks"]
|
|
10
|
+
__version__ = "0.1.3"
|
|
@@ -82,6 +82,33 @@ def validate(sidecar_json: str, media_bytes: bytes) -> ValidationResult:
|
|
|
82
82
|
"""
|
|
83
83
|
...
|
|
84
84
|
|
|
85
|
+
def validate_with_jwks(
|
|
86
|
+
sidecar_json: str, media_bytes: bytes, jwks_json: str
|
|
87
|
+
) -> ValidationResult:
|
|
88
|
+
"""Validate a SignedShot sidecar against media content using pre-loaded JWKS.
|
|
89
|
+
|
|
90
|
+
Use this when you already have the JWKS available locally, avoiding HTTP fetch.
|
|
91
|
+
This is useful for API services that want to validate using their own keys.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
sidecar_json: The sidecar JSON as a string
|
|
95
|
+
media_bytes: The media file content as bytes
|
|
96
|
+
jwks_json: The JWKS JSON as a string (from /.well-known/jwks.json)
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
ValidationResult with detailed information about the validation
|
|
100
|
+
|
|
101
|
+
Raises:
|
|
102
|
+
ValueError: If the sidecar or JWKS cannot be parsed
|
|
103
|
+
|
|
104
|
+
Example:
|
|
105
|
+
>>> jwks_json = '{"keys": [...]}'
|
|
106
|
+
>>> result = validate_with_jwks(sidecar_json, media_bytes, jwks_json)
|
|
107
|
+
>>> if result.valid:
|
|
108
|
+
... print(f"Publisher: {result.capture_trust['publisher_id']}")
|
|
109
|
+
"""
|
|
110
|
+
...
|
|
111
|
+
|
|
85
112
|
def validate_files(sidecar_path: str, media_path: str) -> ValidationResult:
|
|
86
113
|
"""Validate a SignedShot sidecar from file paths.
|
|
87
114
|
|
|
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
|