axiam-sdk (Python)

Official Python client SDK for AXIAM — Access eXtended Identity and Authorization Management.
Platform documentation: https://ilpanich.github.io/axiam/ — getting started, the authorization model, the OAuth2/OIDC surface, and the operations guides. This README covers the SDK; the site covers the server it talks to.
Package identity
Contract conformance
This SDK (1.4.0) conforms to contract 1.69: CONTRACT.md §1–§13 and §12.7, §14, §15, §17,
§19, §20, §21, §22, §23, §24, §25, §26, §27, §28, §28.12, §29, §30, §31, §32, §33, §34 and
§36 (the P1 – P12 clarifications, as contract 1.60 amends them), with §32.7 and §33.2 signed (including §6.1 mTLS, the §10.1 minimum
local-verification set, and §1.1.1/§10.3's gRPC token operations), and — new in contract 1.65 —
§37 (native sign-in with a provider ID token) with the idp_hint input of oidc_begin and
oidc_par (§12.1, §26.2 rule 8; oidc_par pushes the begin URL's hint when its own
argument is unset). Server floor: federation-config admin calls (federation.create_config,
get_config, list_configs, update_config) of this 1.2-line SDK need an AXIAM server
1.2.0 or later: FederationConfigResponse.native_login is required from 1.2.0, and a
response from an older server fails to decode. Contract 1.66 (§34.10) adds no operation:
a federated sign-in is bound to the client that started it (§12.1 rule 12b), so send the
start and the completion of one sign-in through the same client instance — its §4 cookie
jar carries the axiam_fed_bind cookie, and a completion without it is a terminal 401. §12 is
implemented in full at its 1.38 shape: all thirteen operations, including the
four public "Sign in with X" entry points, on both clients.
CONTRACT.md's Conformance Statement for §36 (network segments, reply profiles and the
RADIUS decision, a §27 namespace, ported from the merge commit that carries the routes):
This SDK conforms to CONTRACT.md §1–§13, §14, §15, §17, §19, §27, §28, §28.12, §29, §30, §31, §32, §33, §36 and §37.
Manifest pruning: not offered in any namespace (§27.10; pruning is a MAY, §27.6 rule 4).
§12.7, §14, §15, §20, §22, §24, §25, §26, §27, §28, §28.12, §29, §30, §31, §32, §32.7
and §33 are named rather than folded into the range because they landed after this
SDK already claimed §1–§13: widening the range silently would turn a statement that
was true when written into a different claim without anyone editing it. The §21.3.1
amendment of contract 1.58 (the seventh mtls_endpoint_aliases member,
backchannel_authentication_endpoint) is decoded and honoured on an mTLS CIBA call.
Contract 1.59 adds no section: its §34 clarifications (P1 – P12) bind §28.12 – §33's
behaviour, and this SDK's follow-up (F-59-03) implements the ones its review named —
poll returns what it judged and lists the SETs a
failed key fetch or replay store left unjudged (P1, second form), a 5xx on ciba_poll is
transient whatever its body (P8), an unknown union arm renders for a log line (P12.2), and
a None write-only secret is omitted, never sent as null (P12.3).
Contract 1.69 — the 1.4.0 release
CONTRACT.md 1.69 (server #880, #881, #883): verify_logout_token selects the key by the logout
token's kid (the server now sends one; a token with no kid, or an unknown one, is refused with
AuthError.reason == "unknown_kid", and §10.1 rules 10 and 11 stay off the logout and ID-token
paths); the AMQP requester has no unsigned-response option and emits the §8 discard event.
Contract 1.68 — the 1.4.0 release (security audit 2026-11-14, wave 3)
Ported from CONTRACT.md §8 ("Signed authorization responses"), §10.1 rules 10 – 12, §11.2 rule 11
and §12.8. Four of these are behaviour changes for integrators; the migration for each is in
CHANGELOG.md under [1.4.0].
require_role reads the roles claim only (N15, D-1). It no longer maps the OAuth scope
claim onto roles and fails closed (403) when the token carries no roles claim. Request the
roles scope for it to work. require_scope checks granted scopes. AxiamUser gains scopes
and roles_claim_present.
- The access-token guards refuse tokens that are not access tokens (N14). A
typ other than
at+jwt, a purpose claim and a header with no kid are all refused on
verify_access_token / verify_with_proofs / verify_sender_constrained.
- The login glue binds the callback to the browser that started it (C7) with a
__Host-axiam_oidc_bind cookie, and only follows a same-origin relative return_to (C6).
- A new AMQP authorization requester (N2),
axiam_sdk.amqp.AuthzRequester, which verifies the
server's signed response.
Contract 1.62 — the 1.1.0 release (§34.6)
Contract 1.62 adds one management namespace, network, and changes how a device client
authenticates; the rest is two request-member rules and a read-modify-write form. In this
SDK, which releases it as 1.1.0 (1.0.1 was never tagged, so the 1.61 fields below ship
in the same release):
- §36 —
client.network (and client.management.network, on both clients): twelve
generated operations, list_segments, create_segment, get_segment,
replace_segment, delete_segment, list_profiles, create_profile, get_profile,
replace_profile, delete_profile, get_policy and replace_policy — 202
operations across 29 namespaces. Every write is conditional on the version you read
and sent exactly (delete_segment(id, version) and delete_profile(id, version) take it
as an int; a profile write also carries segment_version), is never retried, and a
409 is a ConflictError whose reason_code (stale_version, strands_profile,
has_children, site_gone, duplicate_name, duplicate_vlan, duplicate_rank,
profile_exists, other, or a value this SDK has not seen, verbatim) says which — branch
on it, never on the message. A reply profile is read as its effective profile
(session_timeout_secs is min(stored, cap), session_timeout_clamped says so), and a
clamped profile cannot be written back to restore its stored timeout: raise the cap first.
The decision route POST /api/v1/network/decide is FreeRADIUS's, not an SDK's, and has no
method here.
- §27.6.2 —
network in the manifest. ManagementManifest(network=NetworkSpec(policy=, segments=, profiles=)). A segment is keyed by site + kind + name with kind the wire
spelling, "access" or "quarantine" (this SDK has no other spelling); a profile by its
segment; the policy is a singleton. plan reads get_policy, list_segments and
list_profiles and judges every stated member on the value as read — a profile's
effective timeout included, so a stated session_timeout_secs above the cap is an
Update whose apply the server refuses with 403 (reported as given; apply stops,
nothing is lowered or retried). filter_ids is compared as a set (a reorder is
NoChange; a repeated Filter-Id in one segment is refused at plan with no request) and
sent in the order you state. An unstated member is carried from the read; a member stated
None is left out of the replacement body (UNSET is the unstated value). Order: policy,
segments, profiles. A profile's segment_version is the version of this apply's own
segment write. A 409 fails that action — StepOutcome.reason_code /
ManifestFailure.reason_code — and re-running apply is the recovery. No pruning: this
SDK prunes nothing in any namespace, so no segment or profile is ever deleted by a manifest.
- §14 — the device grant authenticates its client. A client built with a
client_secret sends it as the client_secret form member at device_authorize and
at every poll (never Authorization: Basic, whichever way it is registered); a client with
a §6.1 certificate presents it on both; a public client sends no credential and is not
refused; the poll sends client_id; a 401 invalid_client is an OAuthProtocolError,
terminal and never refreshed. See Device authorization grant.
- §32.2 —
management.ssf_stream_edit(stream, changes), the change-taking
read-modify-write form: it sends events_requested and expected_updated_at as read (the
server's own string; [] stays []) and cuts events_requested to a lowered
events_allowed. ssf_stream_input stays, and its documentation names the caller's duty;
update_stream's documentation states the three meanings of events_requested — absent
resets to every allowed event, [] is none, a list is stored as given and refused
outside events_allowed.
- §27.11 rule 5 — held already. An assigned
None on user_id
(certificates.generate, sign_csr) or expected_updated_at (ssf.update_stream,
scim_targets.update) is "none": the key is omitted, null is never sent. The request
user_id is a plain str | None, so a malformed value reaches the server and its 400
is raised as ValidationError.
Contract 1.61 — the 1.0.1 fields (§34.5)
Contract 1.61 is additive and clarifying: no route and no operation, one new optional
member on each of three models, and a rule about what a read-modify-write sends. In this
SDK:
- §27.11 rule 5 —
Certificate.user_id (and GeneratedCertificate.user_id): a UUID
string, null and an absent member all decode, the last two as None ("no account
named"), never synthesised from metadata. On CreateCertificateRequest and
SignCertificateCsrRequest it is sent exactly as given, and the key is absent when
you name no account — an assigned None is dropped, never sent as null. The SDK does
not judge the value; the server answers 400.
- §32.2 / §32.3 rule 4 —
SsfStreamInput.expected_updated_at, sent exactly as the
stream's updated_at was read (not re-formatted) and absent when unset. A stream written
since — a receiver's pause or narrowing included — answers 409 (ConflictError),
which is never retried. ssf_stream_input fills it with the updated_at it read and
always carries events_requested as read, [] as [] (absent would reset the
receiver's narrowing to every allowed event); if you lower events_allowed yourself,
cut events_requested to it.
- §33.3 rule 16 —
CibaPendingList.total_pending and truncated are not modelled:
the type belongs to the console's GET /api/v1/ciba/requests route, which no registry
operation returns and no SDK drives.
Contract 1.60 — what changed here
Contract 1.60 adds no section; it answers the questions the 1.59 ports raised (§34.4)
and writes the 1.0.0 server changes into the sections they live in. In this SDK:
- §32.7 / §34.2 P1, P3, P4, P6 — a replay store that cannot answer makes
verify_set raise NetworkError with the store's exception as its __cause__;
in a poll batch the store is then asked nothing more, a later SET that fails
steps 1–8 is still refused, and one that passes them is unjudged. The SSF key cache
expires after 300 s (the contract's bound is 10 minutes), and a failed fill or a
failed refresh of an expired cache counts toward the once-a-minute fetch limit.
- §19.1 — the
ssf_unjudged event (SsfUnjudged): a poll that returns leaving
SETs unjudged says so to the telemetry hook — how many, and whether a key fetch or
the replay store left them — with no jti.
- §34.2 P12.1 — an unknown union arm keeps its discriminator and nothing else.
- §31 —
ScimTargetInput.expected_updated_at, sent exactly as given;
scim_target_input fills it with the updated_at it read, so an update another
administrator overtook is a 409 (ConflictError) rather than a silent overwrite.
- §27.15 —
window_minutes on the notification rules, passed through and never
clamped; the federation configuration's allow_sha1_signatures (absent decodes as
False) and idp_metadata_signing_cert_pem; and on federation.update_config an
explicit None on any of the ten nullable members sends null and clears it, while
a member left unset is not sent and stays as stored.
- §12.1 / §21.5 — an
oidc_refresh result carries the response's scope, which may
be narrower than the grant's; OidcConfiguration decodes the four revocation and
introspection discovery members as optional.
- §1.1.1 rule 7 —
introspect_token returns active: False for a user whose
account may no longer sign in; it never raises for it.
- §15.2 rule 9, §8 — the actor token comes from the same client's
client_credentials grant; a broker confirm is not evidence AXIAM saw a message.
§28 (MCP resource-server helpers) is SHOULD-level, additive and off by default: a
guard built without resource_metadata_url is byte-for-byte what it was before §28
existed. See MCP resource-server helpers (§28).
Contract 1.53 – 1.58 — what this SDK ships
Everything below is on both AxiamClient and AsyncAxiamClient, under the same
names. Nothing in these sections is carved out.