use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum AuthorizationResponseType {
Code,
Token,
IdToken,
}
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum AuthorizationResponseMode {
Query,
Fragment,
FormPost,
}
#[derive(Serialize, Deserialize)]
pub enum AuthorizationCodeChallengeMethod {
S256,
#[serde(rename = "plain")]
Plain,
}
#[derive(Serialize, Deserialize)]
pub struct PushedAuthorizationRequestParameters {
pub response_type: AuthorizationResponseType,
pub redirect_uri: String,
pub state: String,
pub scope: Option<String>,
pub response_mode: Option<AuthorizationResponseMode>,
pub code_challenge: String,
pub code_challenge_method: AuthorizationCodeChallengeMethod,
pub login_hint: Option<String>,
pub prompt: Option<String>,
}
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum TokenGrantType {
AuthorizationCode,
RefreshToken,
}
#[derive(Serialize, Deserialize)]
pub struct TokenRequestParameters {
pub grant_type: TokenGrantType,
pub code: String,
pub redirect_uri: String,
pub code_verifier: String,
}
#[derive(Serialize, Deserialize)]
pub struct RefreshRequestParameters {
pub grant_type: TokenGrantType,
pub refresh_token: String,
pub scope: Option<String>,
}
#[derive(Serialize, Deserialize)]
pub struct RevocationRequestParameters {
pub token: String,
}