mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 19:00:38 +09:00
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
|
|
import { describe, expect, it } from "vitest";
|
||
|
|
import { shouldEnablePrivateHostnameGuard } from "../app.ts";
|
||
|
|
|
||
|
|
describe("shouldEnablePrivateHostnameGuard", () => {
|
||
|
|
it("enables the hostname guard for local_trusted private deployments", () => {
|
||
|
|
expect(shouldEnablePrivateHostnameGuard({
|
||
|
|
deploymentMode: "local_trusted",
|
||
|
|
deploymentExposure: "private",
|
||
|
|
})).toBe(true);
|
||
|
|
});
|
||
|
|
|
||
|
|
it("does not enable the hostname guard for local_trusted public deployments", () => {
|
||
|
|
expect(shouldEnablePrivateHostnameGuard({
|
||
|
|
deploymentMode: "local_trusted",
|
||
|
|
deploymentExposure: "public",
|
||
|
|
})).toBe(false);
|
||
|
|
});
|
||
|
|
|
||
|
|
it("enables the hostname guard for authenticated private deployments", () => {
|
||
|
|
expect(shouldEnablePrivateHostnameGuard({
|
||
|
|
deploymentMode: "authenticated",
|
||
|
|
deploymentExposure: "private",
|
||
|
|
})).toBe(true);
|
||
|
|
});
|
||
|
|
|
||
|
|
it("does not enable the hostname guard for authenticated public deployments", () => {
|
||
|
|
expect(shouldEnablePrivateHostnameGuard({
|
||
|
|
deploymentMode: "authenticated",
|
||
|
|
deploymentExposure: "public",
|
||
|
|
})).toBe(false);
|
||
|
|
});
|
||
|
|
});
|