acme: align Authorization type with RFC structure

This commit is contained in:
Dirkjan Ochtman 2022-04-21 12:43:30 +02:00 committed by Dirkjan Ochtman
parent 8433cd143f
commit e4ef9955a3
2 changed files with 13 additions and 8 deletions

View File

@ -17,8 +17,8 @@ use types::{
KeyAuthorization, KeyOrKeyId, Problem, SigningAlgorithm, KeyAuthorization, KeyOrKeyId, Problem, SigningAlgorithm,
}; };
pub use types::{ pub use types::{
Authorization, ChallengeType, Error, Identifier, LetsEncrypt, NewAccount, NewOrder, OrderState, Authorization, AuthorizationStatus, ChallengeType, Error, Identifier, LetsEncrypt, NewAccount,
OrderStatus, NewOrder, OrderState, OrderStatus,
}; };
pub struct Order { pub struct Order {

View File

@ -213,12 +213,17 @@ pub(crate) struct JoseJson {
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
#[serde(tag = "status", rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum Authorization { pub struct Authorization {
Pending { pub identifier: Identifier,
identifier: Identifier, pub status: AuthorizationStatus,
challenges: Vec<Challenge>, pub challenges: Vec<Challenge>,
}, }
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum AuthorizationStatus {
Pending,
Valid, Valid,
Invalid, Invalid,
Revoked, Revoked,