Skip to content

Commit

Permalink
disallow completely disabling authentication for a protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Jul 10, 2023
1 parent 8173f65 commit b1995be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion warpgate-common/src/auth/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ impl CredentialPolicy for AllCredentialsPolicy {
let valid_credential_types: HashSet<CredentialKind> =
valid_credentials.iter().map(|x| x.kind()).collect();

if valid_credential_types.is_superset(&self.required_credential_types) {
if !valid_credential_types.is_empty()
&& valid_credential_types.is_superset(&self.required_credential_types)
{
CredentialPolicyResponse::Ok
} else {
CredentialPolicyResponse::Need(
Expand Down

0 comments on commit b1995be

Please sign in to comment.