Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+1
-18
@@ -4,7 +4,6 @@ import { app } from "../app.js";
|
||||
import {
|
||||
TEST_API_CONFIG,
|
||||
configureApiIsolationDependenciesForTests,
|
||||
createLegacyEntityFixture,
|
||||
createStoredApiKeyFixture,
|
||||
installApiIsolationTestHooks,
|
||||
} from "./fixtures/api-key.js";
|
||||
@@ -22,7 +21,6 @@ function createBoundaryApiKey(patch: Parameters<typeof createStoredApiKeyFixture
|
||||
id: "api_key_boundary_1",
|
||||
tenantId: "tenant_1",
|
||||
tenant: { id: "tenant_1", name: "Acme", slug: "acme", deactivatedReason: null },
|
||||
entities: [{ entityId: "entity_1", read: true, create: true, update: true, delete: true }],
|
||||
...patch,
|
||||
});
|
||||
}
|
||||
@@ -52,7 +50,6 @@ function createBoundaryDependencies() {
|
||||
tenant: { id: "tenant_2", name: "Other", slug: "other", deactivatedReason: null },
|
||||
});
|
||||
const exportJob = createExportJob();
|
||||
const entity = createLegacyEntityFixture();
|
||||
|
||||
const dependencies = {
|
||||
findLegacyApiKeyByKey: vi.fn(async (key: string) => {
|
||||
@@ -71,12 +68,11 @@ function createBoundaryDependencies() {
|
||||
expiresInSeconds: 300,
|
||||
headers: { "x-download": "allowed" },
|
||||
})),
|
||||
findLegacyEntityByName: vi.fn(async () => entity),
|
||||
};
|
||||
|
||||
configureApiIsolationDependenciesForTests(dependencies);
|
||||
|
||||
return { primaryApiKey, secondTenantApiKey, exportJob, entity, dependencies };
|
||||
return { primaryApiKey, secondTenantApiKey, exportJob, dependencies };
|
||||
}
|
||||
|
||||
function apiKeyHeaders(secret = STORED_API_KEY_SECRET, requestId = REQUEST_ID) {
|
||||
@@ -203,7 +199,6 @@ describe("API-key validation service boundary", () => {
|
||||
expect(dependencies.findLegacyApiKeyByKey).toHaveBeenCalledWith(INVALID_API_KEY_SECRET, undefined, "scope-secret", { allowPlaintextFallback: true });
|
||||
});
|
||||
});
|
||||
|
||||
describe("export download service boundary", () => {
|
||||
test("rejects stored key export lookup when tenantId query is tampered", async () => {
|
||||
const { dependencies } = createBoundaryDependencies();
|
||||
@@ -287,15 +282,3 @@ describe("export download service boundary", () => {
|
||||
expect(dependencies.createSignedDownloadUrl).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe("service-credential-only route boundaries", () => {
|
||||
test("keeps non-CRUD entity metadata route outside stored API-key CRUD scope claims", async () => {
|
||||
const { dependencies } = createBoundaryDependencies();
|
||||
|
||||
const response = await app.request("/v1/entities/contact?tenantId=tenant_1", { headers: apiKeyHeaders(STORED_API_KEY_SECRET, "req_service_only_entity") });
|
||||
|
||||
await expectRedactedError(response, { status: 401, code: "unauthorized", requestId: "req_service_only_entity" });
|
||||
expect(dependencies.findLegacyApiKeyByKey).not.toHaveBeenCalled();
|
||||
expect(dependencies.findLegacyEntityByName).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user