49 std::chrono::seconds cache_ttl = std::chrono::seconds(300));
70 void ensure_keys_locked();
71 void load_from_json(
const std::string& body);
74 std::string base_url_;
75 std::chrono::seconds cache_ttl_;
78 std::map<std::string, Ed25519Jwk> keys_;
79 std::chrono::steady_clock::time_point fetched_at_{};
80 bool have_keys_ =
false;
void refresh_keys()
Force-refresh the cached key set (also called lazily by verify()).
std::size_t cached_key_count()
Test/introspection helper: number of currently-cached keys.
std::optional< VerifiedToken > verify_signature_only_unchecked(const std::string &jwt)
EXPERT PRIMITIVE — signature only.
JwksVerifier(Transport transport, std::string base_url, std::chrono::seconds cache_ttl=std::chrono::seconds(300))
Definition authenticator.hpp:40
std::function< HttpResponse(const HttpRequest &)> Transport
The transport seam. Injectable; defaults to the libcurl implementation.
Definition transport.hpp:56
std::optional< std::string > base64url_decode(const std::string &in)
Base64url decode (unpadded or padded). Returns nullopt on malformed input.
One Ed25519 (OKP) public key from the JWK set.
Definition jwks.hpp:30
std::string kid
Definition jwks.hpp:31
std::string x_b64url
Definition jwks.hpp:32
Result of a successful verification: the decoded payload (claims) JSON string.
Definition jwks.hpp:36
std::string payload_json
Definition jwks.hpp:37