tessl install tessl/pypi-python-jose@3.5.0JOSE implementation in Python providing JWT, JWS, JWE, and JWK functionality with multiple cryptographic backends.
Agent Success
Agent success rate when using this tile
75%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.44x
Baseline
Agent success rate without this tile
52%
A utility for turning JSON payloads into compact signed tokens and verifying them for integrity.
{ "kid": "key1" }) provided at signing time are preserved in the token and surfaced when the token is verified. @testkid header, the verifier selects the matching key from a provided mapping of key IDs to keys; verification fails if no matching key exists. @test@generates
from typing import Any, Dict, Mapping, Optional, Tuple
def sign_payload(payload: Dict[str, Any], key: Any, algorithm: str, headers: Optional[Dict[str, Any]] = None) -> str:
"""Serialize payload as JSON and return a compact JWS using the given algorithm and optional protected headers."""
def verify_payload(token: str, keys: Any | Mapping[str, Any]) -> Tuple[Dict[str, Any], Dict[str, Any]]:
"""Verify the token using a single key or a mapping of key IDs to keys, returning the decoded JSON payload and the protected header."""Provides JWS signing and verification support for compact JOSE tokens.