aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-10 22:33:59 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-10 22:33:59 +0100
commitad3d007068b02613ff22871e6712ab7041ca1019 (patch)
tree8d638245450fa0a602a69099def7e4a1a22037b3 /client.go
parentea51a23c63b779e190256dfb4e72573f0047dac5 (diff)
Add agree, not working
Diffstat (limited to 'client.go')
-rw-r--r--client.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/client.go b/client.go
index a046f84..7a6ec1d 100644
--- a/client.go
+++ b/client.go
@@ -135,6 +135,23 @@ func (c *Client) Register(a *Account) error {
return err
}
+func (c *Client) Agree(a *Account) error {
+ r := Registration{
+ Resource: ResNewReg,
+ Contact: a.Contact,
+ Agreement: c.Links["terms-of-service"],
+ }
+ resp, err := c.post(a, c.Dir.NewReg, r)
+ if err != nil {
+ return err
+ }
+ defer resp.Body.Close()
+ re := RegistrationResp{}
+ err = json.NewDecoder(resp.Body).Decode(&re)
+ log.Println(re)
+ return err
+}
+
func (c *Client) Authorize(a *Account, domain string) error {
az := Authorization{
Resource: ResNewAuthz,