Expand description
evconcierge_client — what a relying party (a direction’s backend: invest, admin, the
Service-Arb panel) calls on concierge, the identity plane.
- Sign-in is concierge’s code flow with PKCE:
PkceVerifier+random_state+Authorize::urlsend the browser to/api/auth/authorize; the callback redeems the code withConciergeClient::exchange_code;ConciergeClient::refresh_client_tokenrotates the pair. ConciergeClient::get_me— the one RPC a relying party’s access token opens. It is also where the party re-readspermissions, the only thing it may gate on.ConciergeClient::publish_catalog(permissions and aliases) andConciergeClient::publish_scope_catalog(approval kinds and notification topics).- The direction’s own inbox (
ScopeInboxService): reads byuser_idunder the client credential alone, writes with the user’s access token as well — seeinbox.
The client secret authenticates the server-to-server calls: in the request body for
the AuthService ones (their wire says so), as x-ev-client-id + authorization: Bearer metadata for ScopeCatalogService (docs/SCOPES-AND-APPROVALS.md §2 of
concierge). It never reaches a browser.
The wire types are concierge’s own evconcierge_contracts, re-exported as proto
for the messages this module takes as they are (a catalog’s aliases, approval kind
specs).
ⓘ
let concierge = ConciergeClient::connect_lazy(ClientConfig::new(grpc_addr, "sa", secret))?;
let verifier = PkceVerifier::generate()?;
let state = random_state()?;
let location = Authorize { concierge_origin, client_id: "sa", redirect_uri, state: &state, verifier: &verifier, prompt: None }.url();
// … the browser comes back with `code` …
let tokens = concierge.exchange_code(&code, redirect_uri, &verifier).await?;
let me = concierge.get_me(&tokens.access_token).await?;Re-exports§
pub use inbox::DEFAULT_INBOX_LIMIT;pub use inbox::InboxQuery;pub use inbox::MarkRead;
Modules§
- inbox
- The direction’s own inbox:
ScopeInboxService, called by the direction’s backend on behalf of a user it knows from its own session (docs/SCOPES-AND-APPROVALS.md §6 of concierge). - proto
Structs§
- Authorize
- Everything
GET /auth/authorizetakes.redirect_urimust be byte for byte the one later passed toexchange_code, and registered for the client at concierge. - Catalog
- A tenant’s catalog for
PublishCatalog: the permissions and aliases its namespace defines. - Client
Config - Where concierge is and who this relying party is to it.
- Client
Tokens - A relying party’s token pair, as
ExchangeCodeandRefreshClientTokenanswer it. Expiries are unix seconds. The access token opensGetMeand nothing else; the refresh token is bound to this client and rotates on every use. - Concierge
Client - A cheaply cloneable handle on concierge for one relying party. Connects on first use, so the service boots (and serves what does not need concierge) while concierge is down.
- Me
- The signed-in user as
GetMetells a relying party. Deliberately narrower than the wire’sUserProfile: the identity-document fields (legal name, date of birth, address, nationality, tax residence, phone) and the KYC level are not the direction’s to hold, and concierge leaves them empty for a relying party anyway. - Pkce
Verifier - The secret half of PKCE. Kept server-side until the callback presents it to
ConciergeClient::exchange_code; only itschallengegoes to the browser. - Scope
Catalog - What
PublishScopeCatalogtakes: the namespace’s approval kinds and notification topics, whole — a kind or topic left out is withdrawn.
Enums§
- Concierge
Error - What a failed call to concierge means to the relying party. Each arm is a different reaction: sign the user out, retry later, show the operator what was refused, or report a bug.
- Prompt
- Ask concierge to show its account picker even when the browser is already signed in.
Constants§
- DEFAULT_
TIMEOUT - How long one call may take, connecting included, unless
ClientConfigsays otherwise. A sign-in callback is waiting on it, so seconds, not a minute.
Functions§
- random_
state - An unguessable
statefor the authorize redirect. The callback compares it with the stored one in constant time and refuses a state it has seen before.