dispatch/vendor/github.com/xenolf/lego/acme/messages.go

104 lines
3.3 KiB
Go
Raw Normal View History

2016-01-04 18:26:32 +00:00
package acme
import (
2018-08-31 01:57:19 +00:00
"encoding/json"
2016-01-04 18:26:32 +00:00
"time"
)
2018-08-31 01:57:19 +00:00
// RegistrationResource represents all important informations about a registration
// of which the client needs to keep track itself.
type RegistrationResource struct {
Body accountMessage `json:"body,omitempty"`
URI string `json:"uri,omitempty"`
2016-01-04 18:26:32 +00:00
}
2018-08-31 01:57:19 +00:00
type directory struct {
NewNonceURL string `json:"newNonce"`
NewAccountURL string `json:"newAccount"`
NewOrderURL string `json:"newOrder"`
RevokeCertURL string `json:"revokeCert"`
KeyChangeURL string `json:"keyChange"`
Meta struct {
TermsOfService string `json:"termsOfService"`
Website string `json:"website"`
CaaIdentities []string `json:"caaIdentities"`
ExternalAccountRequired bool `json:"externalAccountRequired"`
} `json:"meta"`
2016-01-04 18:26:32 +00:00
}
2018-08-31 01:57:19 +00:00
type accountMessage struct {
Status string `json:"status,omitempty"`
Contact []string `json:"contact,omitempty"`
TermsOfServiceAgreed bool `json:"termsOfServiceAgreed,omitempty"`
Orders string `json:"orders,omitempty"`
OnlyReturnExisting bool `json:"onlyReturnExisting,omitempty"`
ExternalAccountBinding json.RawMessage `json:"externalAccountBinding,omitempty"`
2016-01-04 18:26:32 +00:00
}
2018-08-31 01:57:19 +00:00
type orderResource struct {
URL string `json:"url,omitempty"`
Domains []string `json:"domains,omitempty"`
orderMessage `json:"body,omitempty"`
2016-01-04 18:26:32 +00:00
}
2018-08-31 01:57:19 +00:00
type orderMessage struct {
Status string `json:"status,omitempty"`
Expires string `json:"expires,omitempty"`
Identifiers []identifier `json:"identifiers"`
NotBefore string `json:"notBefore,omitempty"`
NotAfter string `json:"notAfter,omitempty"`
Authorizations []string `json:"authorizations,omitempty"`
Finalize string `json:"finalize,omitempty"`
Certificate string `json:"certificate,omitempty"`
2016-01-04 18:26:32 +00:00
}
type authorization struct {
2018-08-31 01:57:19 +00:00
Status string `json:"status"`
Expires time.Time `json:"expires"`
Identifier identifier `json:"identifier"`
Challenges []challenge `json:"challenges"`
2016-01-04 18:26:32 +00:00
}
type identifier struct {
Type string `json:"type"`
Value string `json:"value"`
}
type challenge struct {
2018-08-31 01:57:19 +00:00
URL string `json:"url"`
Type string `json:"type"`
Status string `json:"status"`
Token string `json:"token"`
Validated time.Time `json:"validated"`
KeyAuthorization string `json:"keyAuthorization"`
Error RemoteError `json:"error"`
2016-01-04 18:26:32 +00:00
}
type csrMessage struct {
2018-08-31 01:57:19 +00:00
Csr string `json:"csr"`
2016-01-04 18:26:32 +00:00
}
type revokeCertMessage struct {
Certificate string `json:"certificate"`
}
2018-05-04 21:39:27 +00:00
type deactivateAuthMessage struct {
2018-08-31 01:57:19 +00:00
Status string `jsom:"status"`
2018-05-04 21:39:27 +00:00
}
2016-01-04 18:26:32 +00:00
// CertificateResource represents a CA issued certificate.
// PrivateKey, Certificate and IssuerCertificate are all
// already PEM encoded and can be directly written to disk.
// Certificate may be a certificate bundle, depending on the
// options supplied to create it.
2016-01-04 18:26:32 +00:00
type CertificateResource struct {
Domain string `json:"domain"`
CertURL string `json:"certUrl"`
CertStableURL string `json:"certStableUrl"`
AccountRef string `json:"accountRef,omitempty"`
PrivateKey []byte `json:"-"`
Certificate []byte `json:"-"`
IssuerCertificate []byte `json:"-"`
CSR []byte `json:"-"`
2016-01-04 18:26:32 +00:00
}