pub struct IntrospectResponse {Show 13 fields
pub active: bool,
pub scope: Option<String>,
pub client_id: Option<String>,
pub username: Option<String>,
pub exp: Option<i64>,
pub iat: Option<i64>,
pub sub: Option<String>,
pub aud: Option<Vec<String>>,
pub iss: Option<String>,
pub jti: Option<String>,
pub token_type: Option<String>,
pub upstream_id: Option<i32>,
pub client_bearer_allowed: Option<bool>,
}Expand description
Response from the OAuth 2.0 token introspection endpoint (RFC 7662).
This response indicates whether a token is active and includes metadata about the token if it is active.
This is a cross-repo wire contract. tmc-server’s
app/services/courses_mooc_fi_token_introspector.rb reads active, sub, scope,
exp, iss, token_type, upstream_id and client_bearer_allowed by name from this
JSON. The handler declares its body as serde_json::Value, so the OpenAPI drift gate
cannot see a rename here — tests::golden_serialized_shape is the only thing that can.
Fields§
§active: boolWhether the token is active (required).
scope: Option<String>Space-separated list of scopes (optional, only if active).
client_id: Option<String>Client identifier (optional, only if active).
username: Option<String>Username/subject (optional, only if active and token has user).
exp: Option<i64>Expiration timestamp as Unix time (optional, only if active).
iat: Option<i64>Issued at timestamp as Unix time (optional, only if active).
sub: Option<String>Subject identifier (optional, only if active and token has user).
aud: Option<Vec<String>>Audience (optional, only if active).
iss: Option<String>Issuer (optional, only if active).
jti: Option<String>JWT ID (optional, only if active).
token_type: Option<String>Token type: “Bearer” or “DPoP” (optional, only if active).
upstream_id: Option<i32>The token owner’s legacy TMC upstream_id, when the token has a user and
that user has one. A non-standard claim consumed by tmc-server: it lets
tmc-server resolve a courses.mooc.fi token to a local user by upstream id
while the courses_mooc_fi_user_id backfill is still incomplete.
client_bearer_allowed: Option<bool>Whether the client the token was issued to (the one named by client_id in this
same response, not the introspecting caller) may present it as a plain Bearer
credential. Non-standard; it lets a resource server introspecting our tokens apply the
same bearer_allowed = false rejection
domain::exercise_services::token::UserFromOAuthToken applies here.
Privileged, gated like upstream_id: disclosed only to a confidential caller, and
omitted rather than serialized as false when withheld, so a false is always an
authoritative denial.
Consumers must fail closed: an absent member means “not disclosed” or “server predates it”, never “allowed”, so treat it as not permitted and reject the token.
Implementations§
Trait Implementations§
Source§impl Clone for IntrospectResponse
impl Clone for IntrospectResponse
Source§fn clone(&self) -> IntrospectResponse
fn clone(&self) -> IntrospectResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IntrospectResponse
impl Debug for IntrospectResponse
Source§impl Default for IntrospectResponse
impl Default for IntrospectResponse
Source§fn default() -> IntrospectResponse
fn default() -> IntrospectResponse
Source§impl<'de> Deserialize<'de> for IntrospectResponse
impl<'de> Deserialize<'de> for IntrospectResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for IntrospectResponse
impl PartialEq for IntrospectResponse
Source§impl Serialize for IntrospectResponse
impl Serialize for IntrospectResponse
impl Eq for IntrospectResponse
impl StructuralPartialEq for IntrospectResponse
Auto Trait Implementations§
impl Freeze for IntrospectResponse
impl RefUnwindSafe for IntrospectResponse
impl Send for IntrospectResponse
impl Sync for IntrospectResponse
impl Unpin for IntrospectResponse
impl UnsafeUnpin for IntrospectResponse
impl UnwindSafe for IntrospectResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].