Skip to main content

UserDirectoryClient

Struct UserDirectoryClient 

Source
pub struct UserDirectoryClient<T> { /* private fields */ }
Expand description

UserDirectory — the authoritative user/identity control plane.

Owns investor accounts and their profile metadata. This is the identity plane: money lives in the separate banking plane and is NEVER mirrored here. Every RPC is authorized from the verified access-token Claims injected by the inbound auth layer; self-service RPCs act on the caller’s own sub, admin RPCs are gated by the admin allowlist (config).

Implementations§

Source§

impl UserDirectoryClient<Channel>

Source

pub async fn connect<D>(dst: D) -> Result<UserDirectoryClient<Channel>, Error>
where D: TryInto<Endpoint>, <D as TryInto<Endpoint>>::Error: Into<Box<dyn Error + Sync + Send>>,

Attempt to create a new client by connecting to a given endpoint.

Source§

impl<T> UserDirectoryClient<T>
where T: GrpcService<Body>, <T as GrpcService<Body>>::Error: Into<Box<dyn Error + Sync + Send>>, <T as GrpcService<Body>>::ResponseBody: Body<Data = Bytes> + Send + 'static, <<T as GrpcService<Body>>::ResponseBody as Body>::Error: Into<Box<dyn Error + Sync + Send>> + Send,

Source

pub fn new(inner: T) -> UserDirectoryClient<T>

Source

pub fn with_origin(inner: T, origin: Uri) -> UserDirectoryClient<T>

Source

pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> UserDirectoryClient<InterceptedService<T, F>>

Source

pub fn send_compressed( self, encoding: CompressionEncoding, ) -> UserDirectoryClient<T>

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

Source

pub fn accept_compressed( self, encoding: CompressionEncoding, ) -> UserDirectoryClient<T>

Enable decompressing responses.

Source

pub fn max_decoding_message_size(self, limit: usize) -> UserDirectoryClient<T>

Limits the maximum size of a decoded message.

Default: 4MB

Source

pub fn max_encoding_message_size(self, limit: usize) -> UserDirectoryClient<T>

Limits the maximum size of an encoded message.

Default: usize::MAX

Source

pub async fn get_me( &mut self, request: impl IntoRequest<GetMeRequest>, ) -> Result<Response<UserProfile>, Status>

The calling user’s own identity (resolved from the access-token sub).

Source

pub async fn update_profile( &mut self, request: impl IntoRequest<UpdateProfileRequest>, ) -> Result<Response<UserProfile>, Status>

Update the caller’s own editable profile fields (full-replace of the set in UpdateProfileRequest). Identity/auth fields (email, status) are not editable here.

Source

pub async fn revoke_tokens( &mut self, request: impl IntoRequest<RevokeTokensRequest>, ) -> Result<Response<RevokeTokensResponse>, Status>

Admin (allowlist): bump a user’s token_version so all their outstanding access tokens are rejected. The token-revocation control surface.

Source

pub async fn disable_user( &mut self, request: impl IntoRequest<DisableUserRequest>, ) -> Result<Response<DisableUserResponse>, Status>

👎Deprecated

DEPRECATED — always refuses, naming HoldUser or GovernanceService.OpenUserSuspension.

The verb was ambiguous in the one way that mattered: it was both the emergency brake (the frozen flag the money plane re-reads at dispatch, which stops a withdrawal already in the queue) and a permanent judgement on an account, decided by one person with no record of why. Those need opposite treatments — the first must stay instant, the second must not be one person’s to make — so the caller now has to say which one they mean. Kept in the contract rather than deleted so an older console gets an explanatory refusal instead of an UNIMPLEMENTED.

Source

pub async fn hold_user( &mut self, request: impl IntoRequest<HoldUserRequest>, ) -> Result<Response<HoldUserResponse>, Status>

Admin (UserSuspend): the emergency brake. Freezes the account NOW and lapses on its own after 24h unless the owners ratify it with OpenUserSuspension. One actor may stop money temporarily; one actor may never stop it permanently. Emits SUSPENDED across the cross-plane bridge, and REINSTATED again when it lapses.

Source

pub async fn reinstate_user( &mut self, request: impl IntoRequest<ReinstateUserRequest>, ) -> Result<Response<ReinstateUserResponse>, Status>

Admin (allowlist): re-enable a disabled user, lifting the sign-in/refresh freeze. Emits REINSTATED across the cross-plane bridge.

Refuses with FAILED_PRECONDITION when the suspension was the owners’ verdict, naming GovernanceService.OpenUserReinstatement — otherwise one admin could overturn a consilium and the consilium would be advisory.

Source

pub async fn set_kyc_level( &mut self, request: impl IntoRequest<SetKycLevelRequest>, ) -> Result<Response<SetKycLevelResponse>, Status>

Admin (allowlist): set a user’s KYC level. Emits KYC_CHANGED across the cross-plane bridge (so the money plane learns the new level). Echoes the level now in effect.

Refuses with PERMISSION_DENIED when user_id is the CALLER’s own account. KycManage is held by Admin as well as Owner, and tier 1 is the floor for withdrawals on the money plane, so without this an operator could lift their own money gate. A console must not offer this control on the operator’s own row: the refusal is decided from the session alone and belongs in front of the call. Raising your own level goes through the verification front door, which reaches tier 1; above that, and for any downgrade, another holder of KycManage acts.

Source

pub async fn list_users( &mut self, request: impl IntoRequest<ListUsersRequest>, ) -> Result<Response<ListUsersResponse>, Status>

Admin (UserRead): list/search users for the operator console — paginated, with a free-text query and optional role/status filters (see ListUsersRequest). Returns lightweight summaries, not full profiles.

Source

pub async fn get_user( &mut self, request: impl IntoRequest<GetUserRequest>, ) -> Result<Response<UserProfile>, Status>

Admin (UserRead): the full profile of ANY user by id (the admin sibling of the self-only GetMe), for the user-detail drawer.

Source

pub async fn set_role( &mut self, request: impl IntoRequest<SetRoleRequest>, ) -> Result<Response<SetRoleResponse>, Status>

Admin (RoleGrant, Owner only): set a user’s platform access role. Emits ROLE_CHANGED across the cross-plane bridge so the money plane mirrors it. Echoes the role now in effect.

Source

pub async fn grant_permission( &mut self, request: impl IntoRequest<GrantPermissionRequest>, ) -> Result<Response<GrantPermissionResponse>, Status>

Grant a user a target inside a tenant’s namespace: an alias (sa:operator), a permission (sa:work:leads:read) or a * pattern (sa:work:*). Nothing grants anything in the iam, concierge, bank or seat namespaces (INVALID_ARGUMENT), and nobody grants to their own account (PERMISSION_DENIED). A target the tenant’s catalog does not define grants nothing and is INVALID_ARGUMENT. Re-granting what is held is a no-op.

Who may: a seat holding iam:tenants:grant — any target. The holder of an alias the catalog lets delegate (delegations) — exactly the aliases it delegates, naming the user by account (an email or a username) only (a user_id is PERMISSION_DENIED: ids are visible in the roster, and granting one would reveal its owner’s address). Anyone else, or a target outside the delegation: PERMISSION_DENIED, before the user is looked up. An email names the accounts it is verified on or backs a password of; only when it names none is the handle read as a username.

To a seat: an unknown user or handle is NOT_FOUND; a handle naming several accounts, or a disabled/held account, is FAILED_PRECONDITION with the reason. To a delegate all three are the SAME FAILED_PRECONDITION (“this address cannot be granted access”), so a grant never tells them whether, or how, a handle is known. A delegate gets a budget of GrantPermission + RevokePermission calls per hour (refusals included); past it, RESOURCE_EXHAUSTED.

Source

pub async fn revoke_permission( &mut self, request: impl IntoRequest<RevokePermissionRequest>, ) -> Result<Response<RevokePermissionResponse>, Status>

Take a grant away. Same authority as GrantPermission, either addressing form for a delegate too: the answer depends only on a grant they can already list. NOT_FOUND when the user holds no active grant of that target — including a handle naming nobody, or several accounts. Shares GrantPermission’s budget.

Source

pub async fn list_grants( &mut self, request: impl IntoRequest<ListGrantsRequest>, ) -> Result<Response<ListGrantsResponse>, Status>

The active grants inside one tenant namespace, with each holder’s identity. A seat holding iam:tenants:grant, or a delegate of that namespace — who gets legal_name AND preferred_name empty: the team sees each other’s email, username and grant, and nothing that says who an address belongs to.

Trait Implementations§

Source§

impl<T> Clone for UserDirectoryClient<T>
where T: Clone,

Source§

fn clone(&self) -> UserDirectoryClient<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for UserDirectoryClient<T>
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for UserDirectoryClient<T>

§

impl<T> RefUnwindSafe for UserDirectoryClient<T>
where Grpc<T>: RefUnwindSafe,

§

impl<T> Send for UserDirectoryClient<T>
where Grpc<T>: Send,

§

impl<T> Sync for UserDirectoryClient<T>
where Grpc<T>: Sync,

§

impl<T> Unpin for UserDirectoryClient<T>
where Grpc<T>: Unpin,

§

impl<T> UnsafeUnpin for UserDirectoryClient<T>
where Grpc<T>: UnsafeUnpin,

§

impl<T> UnwindSafe for UserDirectoryClient<T>
where Grpc<T>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more