mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-31 23:41:09 +02:00
authorize: remove incorrect "valid-client-certificate" reason (#4470)
Fix the logic around when to add the default invalid_client_certificate rule: this should only be added if mTLS is enabled and the enforcement mode is not set to "policy". Add a unit test for this logic.
This commit is contained in:
parent
a83375db7f
commit
e448909042
4 changed files with 130 additions and 1 deletions
|
@ -117,7 +117,7 @@ func newPolicyEvaluator(opts *config.Options, store *store.Store) (*evaluator.Ev
|
|||
// It is important to add an invalid_client_certificate rule even when the
|
||||
// mTLS enforcement behavior is set to reject connections at the listener
|
||||
// level, because of the per-route TLSDownstreamClientCA setting.
|
||||
addDefaultClientCertificateRule :=
|
||||
addDefaultClientCertificateRule := opts.HasAnyDownstreamMTLSClientCA() &&
|
||||
opts.DownstreamMTLS.GetEnforcement() != config.MTLSEnforcementPolicy
|
||||
|
||||
clientCertConstraints, err := evaluator.ClientCertConstraintsFromConfig(&opts.DownstreamMTLS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue