squid: base allow list for every authed user, and no start limit on the list reload
This commit is contained in:
parent
10fdf06334
commit
e78a529ec2
1 changed files with 82 additions and 12 deletions
|
|
@ -150,11 +150,15 @@ pkgs.testers.runNixOSTest {
|
|||
"203.0.113.2" = [
|
||||
"forge.t.local"
|
||||
"cache.t.local"
|
||||
"api.t.local"
|
||||
"other.t.local"
|
||||
"deny-canary.invalid"
|
||||
];
|
||||
"127.0.0.1" = [ "loop.t.local" ];
|
||||
${bridgeIp} = [ "bridge.t.local" ];
|
||||
${bridgeIp} = [
|
||||
"bridge.t.local"
|
||||
"basebridge.t.local"
|
||||
];
|
||||
"169.254.169.254" = [ "meta.t.local" ];
|
||||
"fd00:99::2" = [ "ula.t.local" ];
|
||||
"::" = [ "any6.t.local" ];
|
||||
|
|
@ -171,6 +175,10 @@ pkgs.testers.runNixOSTest {
|
|||
environment.systemPackages = [ pkgs.mkpasswd ];
|
||||
services.hyperhive.squid.selfcheck.unrestrictedCanary = "other.t.local";
|
||||
services.hyperhive.squid.selfcheck.canary = "cache.t.local";
|
||||
services.hyperhive.squid.baseAllowedDomains = [
|
||||
"api.t.local"
|
||||
"basebridge.t.local"
|
||||
];
|
||||
services.hyperhive.squid.allowedDomains = [
|
||||
"forge.t.local"
|
||||
"loop.t.local"
|
||||
|
|
@ -324,6 +332,13 @@ pkgs.testers.runNixOSTest {
|
|||
# DES would accept the first eight characters; the hash must not.
|
||||
assert connect("forge.t.local", "atlas:" + PW["atlas"][:8]) == "407", "a prefix of the password"
|
||||
|
||||
with subtest("a base-list name is open to a restricted user, with a credential, and nothing else is"):
|
||||
assert connect("api.t.local", ATLAS) == "200", "restricted user, base name"
|
||||
assert connect("api.t.local") == "407", "no credential"
|
||||
assert connect("api.t.local", "atlas:" + secrets.token_urlsafe(24)) == "407", "wrong password"
|
||||
assert connect("other.t.local", ATLAS) == "403", "control: an unlisted name is still refused"
|
||||
assert connect("basebridge.t.local", ATLAS) == "403", "a base name that resolves to the bridge"
|
||||
|
||||
with subtest("with an empty list every user is restricted"):
|
||||
assert connect("other.t.local", UMA) == "403", "uma, not listed yet"
|
||||
assert connect("other.t.local", ATLAS) == "403"
|
||||
|
|
|
|||
Loading…
Reference in a new issue