apps: sql + get valid one, get by id, insert, generate app id, generate secret

This commit is contained in:
Philippe Loctaux 2023-03-15 22:00:04 +01:00
parent b5c2be6c9f
commit 71b083895d
19 changed files with 490 additions and 0 deletions

31
crates/apps/src/lib.rs Normal file
View file

@ -0,0 +1,31 @@
mod database;
mod error;
use chrono::{DateTime, Utc};
use id::AppID;
pub use crate::error::Error;
#[derive(Debug)]
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
}
}