Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+46
@@ -6,6 +6,7 @@ describe("readAdminSsoEnv", () => {
|
||||
AUTHENTIK_ISSUER_URL: "https://auth.example.test/application/o/hivegrid-admin-panel/",
|
||||
AUTHENTIK_ADMIN_CLIENT_ID: "hivegrid-admin-panel",
|
||||
AUTHENTIK_ADMIN_CLIENT_SECRET: "shh",
|
||||
AUTHENTIK_ADMIN_JIT_DATABASE_URL: "postgresql://hivegrid_authentik_jit:secret@db.example.test:5432/hivegrid",
|
||||
AUTHENTIK_ADMIN_REDIRECT_URI: "https://admin.example.test/auth/admin/callback",
|
||||
};
|
||||
|
||||
@@ -30,9 +31,53 @@ describe("readAdminSsoEnv", () => {
|
||||
expect(message).toContain("AUTHENTIK_ISSUER_URL");
|
||||
expect(message).toContain("AUTHENTIK_ADMIN_CLIENT_ID");
|
||||
expect(message).toContain("AUTHENTIK_ADMIN_CLIENT_SECRET");
|
||||
expect(message).toContain("AUTHENTIK_ADMIN_JIT_DATABASE_URL");
|
||||
expect(message).toContain("AUTHENTIK_ADMIN_REDIRECT_URI");
|
||||
}
|
||||
});
|
||||
|
||||
it("rejects non-TLS remote endpoints and URL credentials", () => {
|
||||
expect(() => readAdminSsoEnv({ ...baseEnv, AUTHENTIK_ISSUER_URL: "http://auth.example.test/issuer" })).toThrowError(
|
||||
/must use HTTPS/,
|
||||
);
|
||||
expect(() => readAdminSsoEnv({ ...baseEnv, AUTHENTIK_ISSUER_URL: "https://user:password@auth.example.test/issuer" })).toThrowError(
|
||||
/must not contain URL credentials/,
|
||||
);
|
||||
});
|
||||
|
||||
it("requires the exact callback path and a same-origin logout redirect", () => {
|
||||
expect(() => readAdminSsoEnv({ ...baseEnv, AUTHENTIK_ADMIN_REDIRECT_URI: "https://admin.example.test/wrong" })).toThrowError(
|
||||
/exact \/auth\/admin\/callback path/,
|
||||
);
|
||||
expect(() =>
|
||||
readAdminSsoEnv({
|
||||
...baseEnv,
|
||||
AUTHENTIK_ADMIN_POST_LOGOUT_REDIRECT_URI: "https://evil.example.test/login?logged_out=1",
|
||||
}),
|
||||
).toThrowError(/must use the admin callback origin/);
|
||||
});
|
||||
|
||||
it("requires the prepared-admin binding capability to use its dedicated login role", () => {
|
||||
expect(() =>
|
||||
readAdminSsoEnv({
|
||||
...baseEnv,
|
||||
AUTHENTIK_ADMIN_JIT_DATABASE_URL: "postgresql://hivegrid_app:secret@db.example.test:5432/hivegrid",
|
||||
}),
|
||||
).toThrowError(/must authenticate as hivegrid_authentik_jit/);
|
||||
});
|
||||
|
||||
it("permits HTTP only for loopback development", () => {
|
||||
expect(
|
||||
readAdminSsoEnv({
|
||||
...baseEnv,
|
||||
AUTHENTIK_ISSUER_URL: "http://127.0.0.1:9000/application/o/hivegrid-admin-panel/",
|
||||
AUTHENTIK_ADMIN_REDIRECT_URI: "http://localhost:3000/auth/admin/callback",
|
||||
}),
|
||||
).toMatchObject({
|
||||
issuerUrl: "http://127.0.0.1:9000/application/o/hivegrid-admin-panel/",
|
||||
redirectUri: "http://localhost:3000/auth/admin/callback",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("isAdminSsoConfigured", () => {
|
||||
@@ -42,6 +87,7 @@ describe("isAdminSsoConfigured", () => {
|
||||
AUTHENTIK_ISSUER_URL: "https://auth.example.test/",
|
||||
AUTHENTIK_ADMIN_CLIENT_ID: "id",
|
||||
AUTHENTIK_ADMIN_CLIENT_SECRET: "secret",
|
||||
AUTHENTIK_ADMIN_JIT_DATABASE_URL: "postgresql://hivegrid_authentik_jit:secret@db.example.test:5432/hivegrid",
|
||||
AUTHENTIK_ADMIN_REDIRECT_URI: "https://admin.example.test/auth/admin/callback",
|
||||
})
|
||||
).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user