simplify if else logic

Signed-off-by: Meredith Lancaster <malancas@github.com>
This commit is contained in:
Meredith Lancaster 2024-10-30 12:58:40 -06:00
parent 41c3ba5fa7
commit 3378b546da

View file

@ -212,9 +212,8 @@ func (p *Policy) verifyCertExtensions(attestation *verification.AttestationProce
if !strings.EqualFold(p.OIDCIssuer, certIssuer) {
if strings.Index(certIssuer, p.OIDCIssuer+"/") == 0 {
return fmt.Errorf("expected Issuer to be %s, got %s -- if you have a custom OIDC issuer policy for your enterprise, use the --cert-oidc-issuer flag with your expected issuer", p.OIDCIssuer, certIssuer)
} else {
return fmt.Errorf("expected Issuer to be %s, got %s", p.OIDCIssuer, certIssuer)
}
return fmt.Errorf("expected Issuer to be %s, got %s", p.OIDCIssuer, certIssuer)
}
}