aboutsummaryrefslogtreecommitdiff
path: root/authorize.go
diff options
context:
space:
mode:
Diffstat (limited to 'authorize.go')
-rw-r--r--authorize.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/authorize.go b/authorize.go
index d86dec8..54b682d 100644
--- a/authorize.go
+++ b/authorize.go
@@ -44,7 +44,7 @@ func (a Authorization) Supported(sol map[ChalType]Solver) []Challenge {
return nil
}
-func (p *Provider) authorize(s Signer, domain string, sol map[ChalType]Solver) error {
+func (p *Provider) Authorize(s Signer, d *Desire, domain string) error {
req := &Authorization{
Resource: ResNewAuthz,
Identifier: Identifier{
@@ -59,17 +59,8 @@ func (p *Provider) authorize(s Signer, domain string, sol map[ChalType]Solver) e
if err := parseJson(resp, req); err != nil {
return err
}
- for _, ch := range req.Supported(sol) {
- if err := p.Solve(s, ch, sol[ch.Type]); err != nil {
- return err
- }
- }
- return nil
-}
-
-func (p *Provider) Authorize(s Signer, d *Desire) error {
- for _, domain := range d.altnames {
- if err := p.authorize(s, domain, d.solver); err != nil {
+ for _, ch := range req.Supported(d.solver) {
+ if err := p.Solve(s, ch, d.solver[ch.Type]); err != nil {
return err
}
}