aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
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
}