|
AXIAM C++ SDK 1.0.0-alpha8
Authentication, authorization, JWKS & route guards (REST + mTLS)
|
#include <client.hpp>
Public Member Functions | |
| Builder & | base_url (std::string url) |
| Server base URL. | |
| Builder & | tenant_slug (std::string slug) |
| Builder & | tenant_id (std::string id) |
| Builder & | org_slug (std::string slug) |
| Builder & | org_id (std::string id) |
| Builder & | with_custom_ca (std::string ca_pem) |
| §6: add a custom CA (PEM) to the trust chain. | |
| Builder & | with_client_cert (std::string cert_pem, std::string key_pem) |
| §6.1: present a client identity certificate (PEM chain + PEM key) for mutual TLS. | |
| Builder & | connect_timeout (std::chrono::milliseconds ms) |
| Builder & | request_timeout (std::chrono::milliseconds ms) |
| Builder & | max_concurrent_requests (unsigned n) |
| How many requests this client may have in flight at once (default 16). | |
| Builder & | transport (Transport t) |
| Override the HTTP transport (test seam). | |
| Builder & | retry_enabled (bool enabled) |
| §16: enable or disable the bounded read-only retry policy. | |
| Builder & | decision_memo_ttl (std::chrono::milliseconds ttl) |
| §17: enable the client-side decision memo with a TTL. | |
| Builder & | telemetry_hook (TelemetryHook hook) |
| §19: install a telemetry sink. | |
| Client | build () |
| Validates required fields and constructs the client. | |
Friends | |
| class | Client |
| Builder & axiam::Client::Builder::base_url | ( | std::string | url | ) |
| Builder & axiam::Client::Builder::tenant_slug | ( | std::string | slug | ) |
| Builder & axiam::Client::Builder::tenant_id | ( | std::string | id | ) |
| Builder & axiam::Client::Builder::org_slug | ( | std::string | slug | ) |
| Builder & axiam::Client::Builder::org_id | ( | std::string | id | ) |
| Builder & axiam::Client::Builder::with_custom_ca | ( | std::string | ca_pem | ) |
§6: add a custom CA (PEM) to the trust chain.
The ONLY TLS-trust escape hatch; never disables verification.
| Builder & axiam::Client::Builder::with_client_cert | ( | std::string | cert_pem, |
| std::string | key_pem | ||
| ) |
§6.1: present a client identity certificate (PEM chain + PEM key) for mutual TLS.
Strict server verification is unchanged.
| Builder & axiam::Client::Builder::connect_timeout | ( | std::chrono::milliseconds | ms | ) |
| Builder & axiam::Client::Builder::request_timeout | ( | std::chrono::milliseconds | ms | ) |
| Builder & axiam::Client::Builder::max_concurrent_requests | ( | unsigned | n | ) |
How many requests this client may have in flight at once (default 16).
The default transport keeps one libcurl handle — and one hot connection — per in-flight request; callers beyond the cap wait for a handle rather than opening unbounded connections to the server.
Before this existed the transport served every caller through a single mutex-guarded handle, so a Client shared across threads had a p95 made of lock queueing rather than of server time. Set this to your application's real concurrency. Ignored when a custom transport() is supplied.
Override the HTTP transport (test seam).
When unset, build() creates the default libcurl transport from the configured TLS material.
| Builder & axiam::Client::Builder::retry_enabled | ( | bool | enabled | ) |
§16: enable or disable the bounded read-only retry policy.
ON BY DEFAULT.
There is deliberately no builder method for the attempt cap, the base delay or the delay cap: §16.1 permits lowering the budget or disabling it, never raising it, and a caller who can raise them turns one client into the herd a backoff exists to prevent. Pass false for exactly one attempt — the right choice for a caller who owns their own retry layer and knows their own deadline.
| Builder & axiam::Client::Builder::decision_memo_ttl | ( | std::chrono::milliseconds | ttl | ) |
§17: enable the client-side decision memo with a TTL.
DISABLED BY DEFAULT, and zero means disabled — not "cache for zero milliseconds".
A TTL above 5 s is CLAMPED to 5 s rather than rejected (§17.1 rule 2), and the clamp is announced through the §19 ConfigClampedEvent.
READ-YOUR-OWN-WRITES IS NOT GUARANTEED. The staleness bound is the TTL in both directions: a grant revoked on the server can still read as allowed for up to the TTL, and a grant just added can still read as denied for up to the TTL. An admin UI that grants a role and immediately re-checks is the case that breaks, and it breaks silently. Switch this on having read that, not because it looks like an easy win.
| Builder & axiam::Client::Builder::telemetry_hook | ( | TelemetryHook | hook | ) |
§19: install a telemetry sink.
Invoked on the calling thread, so it must not block; buffering is the caller's job (§19.2 rule 4). A hook that throws cannot fail the operation that fired it.
| Client axiam::Client::Builder::build | ( | ) |
|
friend |