Compare commits

..

2 commits

Author SHA1 Message Date
004eb94e14 admin api: verify tokens using the new admin api token table
All checks were successful
ci/woodpecker/push/debug Pipeline was successful
ci/woodpecker/pr/debug Pipeline was successful
2025-03-11 13:51:19 +01:00
46f620119b add model for admin key table 2025-03-11 13:51:19 +01:00

View file

@ -10,19 +10,19 @@ mod v2 {
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
pub struct AdminApiToken {
/// An admin API key is a bearer token of the following form:
/// An admin API token is a bearer token of the following form:
/// `<prefix>.<suffix>`
/// Only the prefix is saved here, it is used as a key identifier.
/// The entire API key is hashed and saved in `token_hash` in `state`.
/// Only the prefix is saved here, it is used as an identifier.
/// The entire API token is hashed and saved in `token_hash` in `state`.
pub prefix: String,
/// If the key is not deleted, its parameters
/// If the token is not deleted, its parameters
pub state: crdt::Deletable<AdminApiTokenParams>,
}
#[derive(PartialEq, Eq, Clone, Debug, Serialize, Deserialize)]
pub struct AdminApiTokenParams {
/// The entire API key hashed as a password
/// The entire API token hashed as a password
pub token_hash: String,
/// User-defined name