feat(authn) : add case to test multiples CIDR
Cadoles/bouncer/pipeline/pr-develop Build started... Details

This commit is contained in:
Matthieu Lamalle 2024-08-08 08:57:49 +02:00 committed by wpetit
parent 0b032fccc9
commit 5eac425fda
1 changed files with 17 additions and 0 deletions

View File

@ -39,6 +39,23 @@ func TestMatchAuthorizedCIDRs(t *testing.T) {
}, },
ExpectedResult: false, ExpectedResult: false,
}, },
{
RemoteHostPort: "192.168.1.15:43349",
AuthorizedCIDRs: []string{
"192.168.1.5/32",
"192.168.1.0/24",
},
ExpectedResult: true,
},
{
RemoteHostPort: "192.168.1.15:43349",
AuthorizedCIDRs: []string{
"192.168.1.5/32",
"192.168.1.6/32",
"192.168.1.7/32",
},
ExpectedResult: false,
},
} }
auth := Authenticator{} auth := Authenticator{}