Replace field access by accessor functions

pull/1671/head
Stefan Berthold 1 year ago committed by Herman Slatman
parent c4fb19d01f
commit 83ba0bdc51
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

@ -5,7 +5,6 @@ import (
"context"
"crypto/x509"
"encoding/base64"
"encoding/hex"
"encoding/json"
"net"
"net/http"
@ -275,7 +274,7 @@ func newAuthorization(ctx context.Context, az *acme.Authorization) error {
continue
}
var target = ""
var target string
switch az.Identifier.Type {
case acme.WireID:
wireId, err := wire.ParseID([]byte(az.Identifier.Value))
@ -286,18 +285,13 @@ func newAuthorization(ctx context.Context, az *acme.Authorization) error {
}
clientID := wireId.ClientID
deviceId := strings.Split(strings.Split(clientID, "@")[0], "/")[1]
decoded, err := hex.DecodeString(deviceId)
if err != nil {
return acme.NewError(acme.ErrorMalformedType, "DeviceId is not hexadecimal")
}
_ = decoded
var targetTemplate = ""
var targetTemplate string
switch typ {
case acme.WIREOIDC01:
targetTemplate = prov.GetOptions().GetOIDCOptions().Provider.IssuerURL
targetTemplate = prov.GetOptions().GetOIDCOptions().GetProviderIssuerURL()
case acme.WIREDPOP01:
targetTemplate = prov.GetOptions().GetDPOPOptions().DpopTarget
targetTemplate = prov.GetOptions().GetDPOPOptions().GetDPOPTarget()
default:
}

@ -471,7 +471,7 @@ func wireDPOP01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSO
return WrapErrorISE(err, "error unmarshalling challenge data")
}
issuer := dpopOptions.DpopTarget
issuer := dpopOptions.GetDPOPTarget()
expiry := strconv.FormatInt(time.Now().Add(time.Hour*24*365).Unix(), 10)
cmd := exec.CommandContext(

@ -23,3 +23,10 @@ func (o *DPOPOptions) GetSigningKey() string {
}
return o.SigningKey
}
func (o *DPOPOptions) GetDPOPTarget() string {
if o == nil {
return ""
}
return o.DpopTarget
}

@ -38,6 +38,13 @@ func (o *OIDCOptions) GetProvider(ctx context.Context) *oidc.Provider {
return toProviderConfig(o.Provider).NewProvider(ctx)
}
func (o *OIDCOptions) GetProviderIssuerURL() string {
if o == nil {
return ""
}
return o.Provider.IssuerURL
}
func (o *OIDCOptions) GetConfig() *oidc.Config {
if o == nil {
return &oidc.Config{}

Loading…
Cancel
Save