pub struct Challenge {
pub id: String,
pub authz_id: String,
pub typ: String,
pub token: String,
pub status: ChallengeStatus,
pub validated: Option<i64>,
pub error: Option<Value>,
pub created_at: i64,
}Expand description
An ACME challenge (RFC 8555 §8): one proof the client may offer for its authorization’s identifier.
Which types an authorization carries is decided by
ChallengeRegistry::types_for
— UNIQUE(authz_id, type) allows several, one per type. Whether triggering
one performs a real network check or is accepted outright is the registry’s
bypass setting, not this model’s business.
A failed challenge stores the problem document that explains why in error,
which the client reads back from the challenge object.
Fields§
§id: String§authz_id: String§typ: String§token: String§status: ChallengeStatus§validated: Option<i64>§error: Option<Value>The RFC 8555 problem document of a failed validation. None until one
fails.
created_at: i64Implementations§
Source§impl Challenge
impl Challenge
Sourcepub async fn create(
authz_id: &str,
typ: &str,
database: &Database,
) -> Result<Challenge, Error>
pub async fn create( authz_id: &str, typ: &str, database: &Database, ) -> Result<Challenge, Error>
Creates a new challenge of type typ, with a fresh random token, in the
pending state.
pub async fn find_by_id( id: &str, database: &Database, ) -> Result<Option<Challenge>, Error>
Sourcepub async fn find_by_authz(
authz_id: &str,
database: &Database,
) -> Result<Vec<Challenge>, Error>
pub async fn find_by_authz( authz_id: &str, database: &Database, ) -> Result<Vec<Challenge>, Error>
Lists an authorization’s challenges (creation order), for the
authorization object’s challenges array.
pub async fn mark_valid(&mut self, database: &Database) -> Result<(), Error>
Sourcepub async fn mark_invalid(
&mut self,
error: Value,
database: &Database,
) -> Result<(), Error>
pub async fn mark_invalid( &mut self, error: Value, database: &Database, ) -> Result<(), Error>
Records a failed validation: moves the challenge to the terminal
invalid state, stores the problem document explaining why, and keeps
self in sync.
validated is deliberately not stamped — RFC 8555 §8 defines it as
the time the challenge was successfully validated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Challenge
impl RefUnwindSafe for Challenge
impl Send for Challenge
impl Sync for Challenge
impl Unpin for Challenge
impl UnsafeUnpin for Challenge
impl UnwindSafe for Challenge
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more