Skip to content

Commit

Permalink
feat: prepare response type for introspection
Browse files Browse the repository at this point in the history
Co-authored-by: Kim Tore Jensen <[email protected]>
  • Loading branch information
tronghn and kimtore committed Nov 7, 2024
1 parent b487435 commit 3832ab3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/identity_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::fmt::{Display, Formatter};
use std::marker::PhantomData;
use utoipa::ToSchema;

/// RFC6749 token response from section 5.1.
/// RFC 6749 token response from section 5.1.
#[derive(Serialize, Deserialize, ToSchema)]
pub struct TokenResponse {
pub access_token: String,
Expand All @@ -32,7 +32,16 @@ pub enum TokenType {
Bearer,
}

/// RFC6749 token response from section 5.2.
/// RFC 7662 introspection response from section 2.2.
#[derive(Serialize, Deserialize)]
struct IntrospectResponse {
active: bool,

#[serde(flatten)]
extra: HashMap<String, Value>,
}

/// RFC 6749 token response from section 5.2.
#[derive(Serialize, Deserialize, ToSchema, Debug, Clone)]
pub struct ErrorResponse {
pub error: OAuthErrorCode,
Expand Down

0 comments on commit 3832ab3

Please sign in to comment.