eversal_esi/auth/
model.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Serialize, Deserialize)]
4pub struct AuthenticationData {
5  pub login_url: String,
6  pub state: String,
7}
8
9#[derive(Debug, Serialize, Deserialize)]
10pub struct EveSsoMetaData {
11  pub authorization_endpoint: String,
12  pub code_challenge_methods_supported: Vec<String>,
13  pub issuer: String,
14  pub jwks_uri: String,
15  pub response_types_supported: Vec<String>,
16  pub revocation_endpoint: String,
17  pub revocation_endpoint_auth_methods_supported: Vec<String>,
18  pub subject_types_supported: Vec<String>,
19  pub token_endpoint: String,
20  pub token_endpoint_auth_methods_supported: Vec<String>,
21  pub token_endpoint_auth_signing_alg_values_supported: Vec<String>,
22  pub id_token_signing_alg_values_supported: Vec<String>,
23}
24
25#[derive(Debug, Serialize, Deserialize, Clone)]
26pub struct EveJwtKeys {
27  #[serde(rename = "SkipUnresolvedJsonWebKeys")]
28  pub skip_unresolved_json_web_keys: bool,
29  pub keys: Vec<EveJwtKey>,
30}
31
32#[derive(Debug, Serialize, Deserialize, Clone)]
33#[serde(tag = "alg")]
34pub enum EveJwtKey {
35  RS256 {
36    e: String,
37    kid: String,
38    kty: String,
39    n: String,
40    r#use: String,
41  },
42  ES256 {
43    crv: String,
44    kid: String,
45    kty: String,
46    r#use: String,
47    x: String,
48    y: String,
49  },
50}
51
52#[derive(Debug, Serialize, Deserialize)]
53pub struct EveJwtClaims {
54  pub scp: Option<Vec<String>>,
55  pub jti: String,
56  pub kid: String,
57  pub sub: String,
58  pub azp: String,
59  pub tenant: String,
60  pub tier: String,
61  pub region: String,
62  pub aud: Vec<String>,
63  pub name: String,
64  pub owner: String,
65  pub exp: u64,
66  pub iat: u64,
67  pub iss: String,
68}
69
70#[derive(Debug, serde::Serialize, serde::Deserialize)]
71pub struct RefreshTokenResponse {
72  pub access_token: String,
73  pub token_type: String,
74  pub expires_in: i64,
75  pub refresh_token: String,
76}