Skip to main content

ClientExtension

Struct ClientExtension 

Source
pub struct ClientExtension {
    pub client_id: String,
    pub client_name: Option<String>,
    pub trust_level: ClientTrustLevel,
    pub authorized_scopes: Vec<String>,
    pub authorized_audiences: Vec<String>,
    pub roles: Vec<String>,
    pub permissions: Vec<String>,
    pub teams: Vec<String>,
    pub claims: HashMap<String, Value>,
}
Expand description

The OAuth client / gateway-access principal — what application is brokering the request, as opposed to which user is using it (SubjectExtension) and which attested workload is the network peer (WorkloadIdentity). Populated from a client-credentials or session JWT by an identity-resolver plugin (or supplied directly by a trusted upstream gateway).

The shape is deliberately symmetric with SubjectExtension — roles / permissions / teams / claims appear on both. That lets APL policies write client.roles.contains("partner") and subject.roles.contains("admin") with the same idiom; some IdPs (Keycloak service accounts, Auth0 M2M apps, AWS IAM role grants) attach RBAC grants to clients directly.

Fields§

§client_id: String

OAuth client_id — required. Anchor identifier for the client.

§client_name: Option<String>

Human-readable client name from the IdP. Useful for audit logs.

§trust_level: ClientTrustLevel

Trust classification — see ClientTrustLevel.

§authorized_scopes: Vec<String>

OAuth scopes the IdP authorized for this client (across all audiences). Policy authors use this to gate on what the IdP believes the client is allowed to ask for, before checking whether the specific request stays within those scopes.

§authorized_audiences: Vec<String>

OAuth audiences the IdP authorized this client to address. Different IdPs encode this differently; the resolver normalizes them into this list.

§roles: Vec<String>

Platform-native RBAC roles attached to the client (Keycloak service-account-roles, Auth0 M2M permissions, IAM role grants). Distinct from authorized_scopes — scopes are OAuth-issued, roles are platform-issued.

§permissions: Vec<String>

Platform-native permissions attached to the client.

§teams: Vec<String>

Team / tenant / account memberships, for multi-tenant platforms that scope clients to organizational units.

§claims: HashMap<String, Value>

Raw remaining JWT claims (or equivalent), keyed by claim name. Value (not String) because claim values can be booleans, numbers, nested objects, arrays — policy authors who reach here generally know the claim’s expected shape.

Trait Implementations§

Source§

impl Clone for ClientExtension

Source§

fn clone(&self) -> ClientExtension

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 Debug for ClientExtension

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ClientExtension

Source§

fn default() -> ClientExtension

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ClientExtension

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ClientExtension

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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