2021-07-07 07:24:39 +00:00
|
|
|
//! Basic API types used by most of the PBS code.
|
|
|
|
|
2021-07-07 07:04:09 +00:00
|
|
|
use proxmox::api::schema::{ApiStringFormat, Schema, StringSchema};
|
|
|
|
use proxmox::const_regex;
|
|
|
|
|
|
|
|
const_regex! {
|
|
|
|
pub FINGERPRINT_SHA256_REGEX = r"^(?:[0-9a-fA-F][0-9a-fA-F])(?::[0-9a-fA-F][0-9a-fA-F]){31}$";
|
|
|
|
}
|
|
|
|
|
|
|
|
pub const FINGERPRINT_SHA256_FORMAT: ApiStringFormat =
|
|
|
|
ApiStringFormat::Pattern(&FINGERPRINT_SHA256_REGEX);
|
|
|
|
|
|
|
|
pub const CERT_FINGERPRINT_SHA256_SCHEMA: Schema =
|
|
|
|
StringSchema::new("X509 certificate fingerprint (sha256).")
|
|
|
|
.format(&FINGERPRINT_SHA256_FORMAT)
|
|
|
|
.schema();
|