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,
};
pub use types::{
Authorization, ChallengeType, Error, Identifier, LetsEncrypt, NewAccount, NewOrder, OrderState,
OrderStatus,
Authorization, AuthorizationStatus, ChallengeType, Error, Identifier, LetsEncrypt, NewAccount,
NewOrder, OrderState, OrderStatus,
};
pub struct Order {

View File

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