aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-10 22:25:35 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-10 22:25:35 +0100
commitea51a23c63b779e190256dfb4e72573f0047dac5 (patch)
tree825377a2f40f41290f23473701ffcf701fb33843 /client.go
parent744acf66b419280a430005e682ad224d500186a3 (diff)
Add authz stub
Diffstat (limited to 'client.go')
-rw-r--r--client.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/client.go b/client.go
index d1705e7..a046f84 100644
--- a/client.go
+++ b/client.go
@@ -135,6 +135,21 @@ func (c *Client) Register(a *Account) error {
return err
}
-func (c *Client) Authorize(a *Account, d []string) error {
- return nil
+func (c *Client) Authorize(a *Account, domain string) error {
+ az := Authorization{
+ Resource: ResNewAuthz,
+ Identifier: Identifier{
+ Type: IdentDNS,
+ Value: domain,
+ },
+ }
+ resp, err := c.post(a, c.Dir.NewAuthz, az)
+ if err != nil {
+ return err
+ }
+ defer resp.Body.Close()
+ ae := AuthorizationResp{}
+ err = json.NewDecoder(resp.Body).Decode(&ae)
+ log.Println(ae)
+ return err
}