2023-07-05 01:13:06 +02:00
|
|
|
use crate::v1::ApiTokenPurpose;
|
2022-11-17 01:06:13 +01:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use url::Url;
|
2023-07-05 01:13:06 +02:00
|
|
|
use uuid::Uuid;
|
2022-11-17 01:06:13 +01:00
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
/// This is a description of a linked or connected application for a user. This is
|
|
|
|
/// used in the UI to render applications on the dashboard for a user to access.
|
|
|
|
pub enum AppLink {
|
|
|
|
Oauth2 {
|
2022-11-21 02:59:47 +01:00
|
|
|
name: String,
|
2022-11-17 01:06:13 +01:00
|
|
|
display_name: String,
|
|
|
|
redirect_url: Url,
|
2022-11-21 02:59:47 +01:00
|
|
|
// Where the icon can be retrieved from.
|
|
|
|
icon: Option<Url>,
|
|
|
|
},
|
2022-11-17 01:06:13 +01:00
|
|
|
}
|
2023-07-05 01:13:06 +02:00
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize, Clone)]
|
|
|
|
#[serde(rename_all = "lowercase")]
|
|
|
|
pub struct ScimSyncToken {
|
|
|
|
// uuid of the token?
|
|
|
|
pub token_id: Uuid,
|
|
|
|
#[serde(with = "time::serde::timestamp")]
|
|
|
|
pub issued_at: time::OffsetDateTime,
|
|
|
|
#[serde(default)]
|
|
|
|
pub purpose: ApiTokenPurpose,
|
|
|
|
}
|