pub struct Challenge {
pub type: String,
pub status: ChallengeStatus,
pub validated: Option<String>,
pub error: Option<ServerError>,
pub token: Option<String>,
/* private fields */
}
Expand description
A challenge represents a means for the server to validate that an account has control over an identifier (domain).
A challenge can only be acquired through an Authorization
.
Fields
type: String
The type of challenge encoded in the object.
status: ChallengeStatus
The status of this challenge.
validated: Option<String>
The time at which the server validated this challenge.
error: Option<ServerError>
Error that occurred while the server was validating the challenge, if any.
token: Option<String>
A random value that uniquely identifies the challenge.
Implementations
sourceimpl Challenge
impl Challenge
The key authorization is the token that the HTTP01 challenge should be serving for the ACME server to inspect.
The encoded key authorization is the token that the DNS01 challenge should be serving for the ACME server to inspect.
sourcepub async fn validate(&self) -> Result<Challenge, Error>
pub async fn validate(&self) -> Result<Challenge, Error>
Initiate validation of the challenge by the ACME server.
Before calling this method, you should have set up your challenge token so it is available for the ACME server to check.
In most cases this will not complete immediately. You should always
call Challenge::wait_done
after this operation to wait until the
ACME server has finished validation.
sourcepub async fn poll(&self) -> Result<Challenge, Error>
pub async fn poll(&self) -> Result<Challenge, Error>
Update the challenge to match the current server state.
Most users should use Challenge::wait_done
.
sourcepub async fn wait_done(
self,
poll_interval: Duration,
attempts: usize
) -> Result<Challenge, Error>
pub async fn wait_done(
self,
poll_interval: Duration,
attempts: usize
) -> Result<Challenge, Error>
Wait for the authorization to go into the AuthorizationStatus::Valid
or AuthorizationStatus::Invalid
state.
Will complete immediately if the authorization is already in one of these states.
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.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Challenge
impl<'de> Deserialize<'de> for Challenge
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Challenge
impl Send for Challenge
impl Sync for Challenge
impl Unpin for Challenge
impl !UnwindSafe for Challenge
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more