mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-13 11:23:39 +02:00
role based content
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
use zeroize::Zeroize;
|
||||
|
||||
pub const TOKEN_NO_AUTH: &str = "authorized";
|
||||
|
||||
pub const ROLE_ADMIN: &str = "ADMIN";
|
||||
pub const ROLE_USER: &str = "USER";
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct Claims {
|
||||
pub username: String,
|
||||
pub iss: String,
|
||||
pub iat: i64,
|
||||
pub exp: i64,
|
||||
pub roles: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
pub struct UserCredential {
|
||||
pub username: String,
|
||||
|
||||
Reference in New Issue
Block a user