Simplify the DPoP target provider functionality

This commit is contained in:
Herman Slatman 2024-02-06 17:11:32 +01:00
parent c6a6622892
commit 2e78301189
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

View File

@ -284,15 +284,7 @@ func newAuthorization(ctx context.Context, az *acme.Authorization) error {
if wireOptions == nil {
return acme.NewErrorISE("failed getting Wire options")
}
var targetProvider interface{ EvaluateTarget(string) (string, error) }
switch typ {
case acme.WIREOIDC01:
targetProvider = wireOptions.GetOIDCOptions()
default:
return acme.NewError(acme.ErrorMalformedType, "unsupported type %q", typ)
}
target, err = targetProvider.EvaluateTarget("")
target, err = wireOptions.GetOIDCOptions().EvaluateTarget("")
if err != nil {
return acme.WrapError(acme.ErrorMalformedType, err, "invalid Go template registered for 'target'")
}
@ -309,15 +301,7 @@ func newAuthorization(ctx context.Context, az *acme.Authorization) error {
if wireOptions == nil {
return acme.NewErrorISE("failed getting Wire options")
}
var targetProvider interface{ EvaluateTarget(string) (string, error) }
switch typ {
case acme.WIREDPOP01:
targetProvider = wireOptions.GetDPOPOptions()
default:
return acme.NewError(acme.ErrorMalformedType, "unsupported type %q", typ)
}
target, err = targetProvider.EvaluateTarget(clientID.DeviceID)
target, err = wireOptions.GetDPOPOptions().EvaluateTarget(clientID.DeviceID)
if err != nil {
return acme.WrapError(acme.ErrorMalformedType, err, "invalid Go template registered for 'target'")
}