From 5dd267af24d709292ed7c48c213b7bfd0d7b9269 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 13 Dec 2015 03:18:59 +0100 Subject: Combine messages --- messages.go | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) (limited to 'messages.go') diff --git a/messages.go b/messages.go index c4bf8e5..444e4d8 100644 --- a/messages.go +++ b/messages.go @@ -24,20 +24,15 @@ type Directory struct { // Registration Objects type Registration struct { - Resource Resource `json:"resource"` // new-reg - Contact Contacts `json:"contact,omitempty"` - Agreement string `json:"agreement,omitempty"` - Authorizations string `json:"authorizations,omitempty"` - Certificates string `json:"certificates,omitempty"` -} - -// RegistrationResp ... -type RegistrationResp struct { - ID int `json:"id"` - Key Key `json:"key"` - Contact Contacts `json:"contact"` - InitialIP net.IP `json:"initialIp"` // not in draft - CreatedAt time.Time `json:"createdAt"` // 2006-01-02T15:04:05.999999999Z + Resource Resource `json:"resource"` // new-reg + Contact Contacts `json:"contact,omitempty"` + Agreement string `json:"agreement,omitempty"` + Authorizations string `json:"authorizations,omitempty"` + Certificates string `json:"certificates,omitempty"` + ID int `json:"id,omitempty"` + Key *Key `json:"key,omitempty"` + InitialIP net.IP `json:"initialIp,omitempty"` // not in draft + CreatedAt *time.Time `json:"createdAt,omitempty"` // 2006-01-02T15:04:05.999999999Z } // Key contains public part of jose.JsonWebKey @@ -49,17 +44,12 @@ type Key struct { // Authorization request type Authorization struct { - Resource Resource `json:"resource"` // new-authz - Identifier Identifier `json:"identifier"` -} - -// AuthorizationResp Objects -type AuthorizationResp struct { + Resource Resource `json:"resource"` // new-authz Identifier Identifier `json:"identifier"` - Status Status `json:"status,omitemtpy"` // e.g. valid - Expires time.Time `json:"expires,omitempty"` // 2006-01-02 - Challenges []Challenge `json:"challenges"` - Combinations [][]int `json:"combinations,omitemtpy"` + Status Status `json:"status,omitempty"` // e.g. valid + Expires *time.Time `json:"expires,omitempty"` // 2006-01-02 + Challenges []Challenge `json:"challenges,omitempty"` + Combinations [][]int `json:"combinations,omitempty"` } // Identifier ... @@ -70,10 +60,13 @@ type Identifier struct { // Challege ... type Challenge struct { - Type ChallengeType `json:"type"` // http-01 - Status Status `json:"status"` // e.g. valid - Validated time.Time `json:"validated"` // 2006-01-02T15:04Z - KeyAuthorization string `json:"keyAuthorization"` + Resource Resource `json:"resource"` // challenge + Type ChallengeType `json:"type"` + Token string `json:"token"` + Status Status `json:"status,omitempty"` // e.g. valid + URI string `json:"uri,omitempty"` + Validated *time.Time `json:"validated,omitempty"` // 2006-01-02T15:04Z + KeyAuthorization string `json:"keyAuthorization,omitempty"` } // Problem description -- cgit v1.2.3