Skip to content

Commit

Permalink
Refactor: Extract ErrProxyPublicAddressNotFound
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-nero authored and smallinsky committed Nov 13, 2024
1 parent 61102a0 commit 60d355a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/utils/oidc/issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ import (
"github.com/gravitational/teleport/api/types"
)

// ProxyGetter is a service that gets proxies.
// ErrProxyPublicAddressNotFound is returned when the proxy public address is not found.
// during IssuerForCluster call.
var ErrProxyPublicAddressNotFound = trace.BadParameter("failed to get Proxy Public Address")

// ProxiesGetter is a service that gets proxies.
type ProxiesGetter interface {
// GetProxies returns a list of registered proxies.
GetProxies() ([]types.Server, error)
Expand All @@ -50,7 +54,7 @@ func IssuerForCluster(ctx context.Context, clt ProxiesGetter, path string) (stri
}
}

return "", trace.BadParameter("failed to get Proxy Public Address")
return "", ErrProxyPublicAddressNotFound
}

// IssuerFromPublicAddress is the address for an OIDC Provider.
Expand Down

0 comments on commit 60d355a

Please sign in to comment.