AXIAM C++ SDK 1.0.0-alpha8
Authentication, authorization, JWKS & route guards (REST + mTLS)
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
axiam::Client::Builder Class Reference

#include <client.hpp>

Public Member Functions

Builderbase_url (std::string url)
 Server base URL.
 
Buildertenant_slug (std::string slug)
 
Buildertenant_id (std::string id)
 
Builderorg_slug (std::string slug)
 
Builderorg_id (std::string id)
 
Builderwith_custom_ca (std::string ca_pem)
 §6: add a custom CA (PEM) to the trust chain.
 
Builderwith_client_cert (std::string cert_pem, std::string key_pem)
 §6.1: present a client identity certificate (PEM chain + PEM key) for mutual TLS.
 
Builderconnect_timeout (std::chrono::milliseconds ms)
 
Builderrequest_timeout (std::chrono::milliseconds ms)
 
Buildermax_concurrent_requests (unsigned n)
 How many requests this client may have in flight at once (default 16).
 
Buildertransport (Transport t)
 Override the HTTP transport (test seam).
 
Builderretry_enabled (bool enabled)
 §16: enable or disable the bounded read-only retry policy.
 
Builderdecision_memo_ttl (std::chrono::milliseconds ttl)
 §17: enable the client-side decision memo with a TTL.
 
Buildertelemetry_hook (TelemetryHook hook)
 §19: install a telemetry sink.
 
Client build ()
 Validates required fields and constructs the client.
 

Friends

class Client
 

Member Function Documentation

◆ base_url()

Builder & axiam::Client::Builder::base_url ( std::string  url)

Server base URL.

MUST be https:// (§6); a plaintext http:// base is rejected by build() unless the host is a loopback development host (localhost, 127.0.0.1, ::1).

◆ tenant_slug()

Builder & axiam::Client::Builder::tenant_slug ( std::string  slug)

◆ tenant_id()

Builder & axiam::Client::Builder::tenant_id ( std::string  id)

◆ org_slug()

Builder & axiam::Client::Builder::org_slug ( std::string  slug)

◆ org_id()

Builder & axiam::Client::Builder::org_id ( std::string  id)

◆ with_custom_ca()

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.

◆ with_client_cert()

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.

◆ connect_timeout()

Builder & axiam::Client::Builder::connect_timeout ( std::chrono::milliseconds  ms)

◆ request_timeout()

Builder & axiam::Client::Builder::request_timeout ( std::chrono::milliseconds  ms)

◆ max_concurrent_requests()

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.

◆ transport()

Builder & axiam::Client::Builder::transport ( Transport  t)

Override the HTTP transport (test seam).

When unset, build() creates the default libcurl transport from the configured TLS material.

◆ retry_enabled()

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.

◆ decision_memo_ttl()

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.

◆ telemetry_hook()

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.

◆ build()

Client axiam::Client::Builder::build ( )

Validates required fields and constructs the client.

Exceptions
std::invalid_argumentif base_url is empty or is not an https:// URL (loopback hosts excepted, §6).
AuthErrorif neither tenant_slug nor tenant_id was provided.

Friends And Related Symbol Documentation

◆ Client

friend class Client
friend

The documentation for this class was generated from the following file: