43 lines
850 B
Rust
43 lines
850 B
Rust
mod database;
|
|
mod error;
|
|
mod get_valid;
|
|
|
|
use chrono::{DateTime, Utc};
|
|
use id::AppID;
|
|
use serde::Serialize;
|
|
|
|
pub use crate::error::Error;
|
|
pub use get_valid::Error as GetValidError;
|
|
|
|
#[derive(Serialize, Debug, Clone)]
|
|
pub struct App {
|
|
id: AppID,
|
|
created_at: DateTime<Utc>,
|
|
updated_at: DateTime<Utc>,
|
|
label: String,
|
|
redirect_uri: String,
|
|
secret: String,
|
|
is_confidential: bool,
|
|
is_archived: bool,
|
|
}
|
|
|
|
impl App {
|
|
pub fn id(&self) -> &AppID {
|
|
&self.id
|
|
}
|
|
pub fn label(&self) -> &str {
|
|
&self.label
|
|
}
|
|
pub fn redirect_uri(&self) -> &str {
|
|
&self.redirect_uri
|
|
}
|
|
pub fn is_archived(&self) -> bool {
|
|
self.is_archived
|
|
}
|
|
pub fn is_confidential(&self) -> bool {
|
|
self.is_confidential
|
|
}
|
|
pub fn secret_hashed(&self) -> &str {
|
|
&self.secret
|
|
}
|
|
}
|