fathom.AttestationService¶
fathom.AttestationService
¶
Signs evaluation results using Ed25519 JWT tokens.
Source code in src/fathom/attestation.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 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 128 129 130 131 132 | |
generate_keypair()
classmethod
¶
Generate a new Ed25519 keypair and return an AttestationService.
Source code in src/fathom/attestation.py
from_private_key_bytes(key_bytes)
classmethod
¶
Create from serialized private key bytes (PEM).
Source code in src/fathom/attestation.py
sign(result, session_id, input_facts=None)
¶
Sign an evaluation result and return a JWT token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
EvaluationResult
|
The evaluation result to attest. |
required |
session_id
|
str
|
Session the evaluation ran under. |
required |
input_facts
|
list[dict[str, Any]] | None
|
The caller-supplied facts the decision was
computed over. Required — the token's |
None
|
Raises:
| Type | Description |
|---|---|
AttestationError
|
input_facts is |
Source code in src/fathom/attestation.py
sign_event(payload)
¶
Sign an arbitrary JSON payload and return a JWT token.
Wraps payload as {"iss": "fathom", "iat": <unix ts>, **payload} and
signs with the runtime Ed25519 key. Intended for audit events (e.g.
hot-reload) that are not shaped like an EvaluationResult.
Source code in src/fathom/attestation.py
sign_claims(claims, headers=None)
¶
Sign a claim set exactly as given (no iss/iat injection).
Used by :class:fathom.chained_log.ChainedAttestationLog, which
manages its own issuer and timestamps. headers are added to the
JWS protected header (e.g. kid).