mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 01:09:56 +00:00
CC-796: Remove dependency on unsupported version of go-oidc
This commit is contained in:

committed by
Nuno Diegues

parent
1b511b2d25
commit
9422ea8ed8
11
vendor/gopkg.in/coreos/go-oidc.v2/verify.go
generated
vendored
11
vendor/gopkg.in/coreos/go-oidc.v2/verify.go
generated
vendored
@@ -79,7 +79,9 @@ type Config struct {
|
||||
ClientID string
|
||||
// If specified, only this set of algorithms may be used to sign the JWT.
|
||||
//
|
||||
// Since many providers only support RS256, SupportedSigningAlgs defaults to this value.
|
||||
// If the IDTokenVerifier is created from a provider with (*Provider).Verifier, this
|
||||
// defaults to the set of algorithms the provider supports. Otherwise this values
|
||||
// defaults to RS256.
|
||||
SupportedSigningAlgs []string
|
||||
|
||||
// If true, no ClientID check performed. Must be true if ClientID field is empty.
|
||||
@@ -105,6 +107,13 @@ type Config struct {
|
||||
// The returned IDTokenVerifier is tied to the Provider's context and its behavior is
|
||||
// undefined once the Provider's context is canceled.
|
||||
func (p *Provider) Verifier(config *Config) *IDTokenVerifier {
|
||||
if len(config.SupportedSigningAlgs) == 0 && len(p.algorithms) > 0 {
|
||||
// Make a copy so we don't modify the config values.
|
||||
cp := &Config{}
|
||||
*cp = *config
|
||||
cp.SupportedSigningAlgs = p.algorithms
|
||||
config = cp
|
||||
}
|
||||
return NewVerifier(p.issuer, p.remoteKeySet, config)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user