pub struct Authorization {
pub identifier: Identifier,
pub status: AuthorizationStatus,
pub expires: Option<String>,
pub challenges: Vec<Challenge>,
pub wildcard: Option<bool>,
/* private fields */
}Expand description
An autorization represents the server’s authorization of a certain domain being represented by an account.
Fields§
§identifier: IdentifierThe identifier (domain) that the account is authorized to represent.
status: AuthorizationStatusThe status of this authorization.
expires: Option<String>The timestamp after which the server will consider this authorization invalid.
challenges: Vec<Challenge>For pending authorizations, the challenges that the client can fulfill in order to prove possession of the identifier. For valid authorizations, the challenge that was validated. For invalid authorizations, the challenge that was attempted and failed.
wildcard: Option<bool>Whether this authorization was created for a wildcard identifier (domain).
Implementations§
Source§impl Authorization
impl Authorization
Sourcepub fn get_challenge(&self, type: &str) -> Option<Challenge>
pub fn get_challenge(&self, type: &str) -> Option<Challenge>
Get a certain type of challenge to complete.
Example: http-01, or dns-01
Sourcepub async fn poll(self) -> Result<Authorization, Error>
pub async fn poll(self) -> Result<Authorization, Error>
Update the authorization to match the current server state.
Most users should use Authorization::wait_done.
Sourcepub async fn wait_done(
self,
poll_interval: Duration,
attempts: usize,
) -> Result<Authorization, Error>
pub async fn wait_done( self, poll_interval: Duration, attempts: usize, ) -> Result<Authorization, Error>
Wait for the authorization to go into a state other than
AuthorizationStatus::Pending.
This will only happen once one of the challenges in an authorization
is completed. You can use Challenge::wait_done to wait until
this is the case.
Will complete immediately if the authorization is already in a
state other than AuthorizationStatus::Pending.
Specify the interval at which to poll the acme server, and how often to attempt polling before timing out. Polling should not happen faster than about every 5 seconds to avoid rate limits in the acme server.