Skip to content

Commit

Permalink
Orders don't have a "deactivated" status.
Browse files Browse the repository at this point in the history
Use "invalid" instead, and add comments linking to the spec.
  • Loading branch information
jsha committed Feb 24, 2020
1 parent 52b9274 commit 57cdb2e
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions core/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,16 @@ func (o *Order) GetStatus() (string, error) {
}
}

// An order is invalid if **any** of its authzs are invalid
if authzStatuses[acme.StatusInvalid] > 0 {
// An order is invalid if **any** of its authzs are invalid,
// deactivated, or expired
// https://tools.ietf.org/html/rfc8555#page-32
if authzStatuses[acme.StatusInvalid] > 0 ||
authzStatuses[acme.StatusDeactivated] > 0 ||
authzStatuses[acme.StatusExpired] > 0 {
return acme.StatusInvalid, nil
}

// An order is expired if **any** of its authzs are expired
if authzStatuses[acme.StatusExpired] > 0 {
return acme.StatusInvalid, nil
}

// An order is deactivated if **any** of its authzs are deactivated
if authzStatuses[acme.StatusDeactivated] > 0 {
return acme.StatusDeactivated, nil
}

// An order is pending if **any** of its authzs are pending
// Otherwise, an order is pending if **any** of its authzs are pending
if authzStatuses[acme.StatusPending] > 0 {
return acme.StatusPending, nil
}
Expand Down

0 comments on commit 57cdb2e

Please sign in to comment.