Make the `Target` optional in `Challenge` object

This is a non-standard property in the ACME challenge response, so
we shouldn't return it if it's not set. Also made it an optional
field in the DB.
pull/1671/head
Herman Slatman 5 months ago
parent 85309bb8ec
commit 01169b2483
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

@ -82,7 +82,7 @@ type Challenge struct {
Token string `json:"token"`
ValidatedAt string `json:"validated,omitempty"`
URL string `json:"url"`
Target string `json:"target"`
Target string `json:"target,omitempty"`
Error *Error `json:"error,omitempty"`
}

@ -19,7 +19,7 @@ type dbChallenge struct {
Status acme.Status `json:"status"`
Token string `json:"token"`
Value string `json:"value"`
Target string `json:"target"`
Target string `json:"target,omitempty"`
ValidatedAt string `json:"validatedAt"`
CreatedAt time.Time `json:"createdAt"`
Error *acme.Error `json:"error"` // TODO(hs): a bit dangerous; should become db-specific type

Loading…
Cancel
Save