@@ -3,9 +3,11 @@ package acmeapi
33import (
44 "encoding/json"
55 "fmt"
6- denet "github.com/hlandau/goutils/net"
7- "gopkg.in/square/go-jose.v1"
6+ "net"
87 "time"
8+
9+ denet "github.com/hlandau/goutils/net"
10+ jose "gopkg.in/square/go-jose.v1"
911)
1012
1113// Represents an account registration.
@@ -28,6 +30,25 @@ type Registration struct {
2830 LatestAgreementURI string `json:"-"`
2931}
3032
33+ // Represents an error that may have happened.
34+ // https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00
35+ type ProblemDetails struct {
36+ Type string `json:"type,omitempty"`
37+ Detail string `json:"detail,omitempty"`
38+ HTTPStatus int `json:"status,omitempty"`
39+ }
40+
41+ // Represents a single validation attempt.
42+ type ValidationRecord struct {
43+ Authorities []string `json:",omitempty"`
44+ URL string `json:"url,omitempty"`
45+ Hostname string `json:"hostname"`
46+ Port string `json:"port"`
47+ AddressesResolved []net.IP `json:"addressesResolved"`
48+ AddressUsed net.IP `json:"addressUsed"`
49+ AddressesTried []net.IP `json:"addressesTried"`
50+ }
51+
3152// Represents a Challenge which is part of an Authorization.
3253type Challenge struct {
3354 URI string `json:"uri"` // The URI of the challenge.
@@ -41,6 +62,10 @@ type Challenge struct {
4162 // proofOfPossession
4263 Certs []denet.Base64up `json:"certs,omitempty"`
4364
65+ Error * ProblemDetails `json:"error,omitempty"`
66+ ProvidedKeyAuthorization string `json:"keyAuthorization,omitempty"`
67+ ValidationRecord []ValidationRecord `json:"validationRecord,omitempty"`
68+
4469 retryAt time.Time
4570}
4671
0 commit comments