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,7 +1,7 @@
|
||||
import { Hono } from "hono";
|
||||
import type { ApiConfig } from "@toolctrl/config";
|
||||
import type { LegacyApiKeySimple } from "@toolctrl/db/api-keys.server";
|
||||
import { SUBSCRIPTION_FEATURE_LIMIT, type TenantApiUsageFeature } from "@toolctrl/db/usage.server";
|
||||
import type { ApiConfig } from "@hivegrid/config";
|
||||
import type { LegacyApiKeySimple } from "@hivegrid/db/api-keys.server";
|
||||
import { SUBSCRIPTION_FEATURE_LIMIT, type TenantApiUsageFeature } from "@hivegrid/db/usage.server";
|
||||
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
|
||||
import { resetApiRuntimeConfigForTests, setApiRuntimeConfigForTests } from "../config.js";
|
||||
@@ -27,7 +27,8 @@ const TEST_API_CONFIG: ApiConfig = {
|
||||
jwtSecret: "usage-route-secret",
|
||||
analytics: {},
|
||||
mailjet: {},
|
||||
stripe: {},
|
||||
lago: { timeoutMs: 10000 },
|
||||
mollie: { timeoutMs: 10000 },
|
||||
apiKeys: {
|
||||
allowLegacyPlaintextFallback: true,
|
||||
},
|
||||
@@ -51,8 +52,9 @@ function createApiKeyFixture(patch: Partial<LegacyApiKeySimple> = {}): LegacyApi
|
||||
alias: "Primary usage key",
|
||||
expires: null,
|
||||
tenantId,
|
||||
createdByUserId: "user_usage_1",
|
||||
active: true,
|
||||
entities: [],
|
||||
scopes: ["*"],
|
||||
tenant: { id: tenantId, name: "Acme Usage", slug: "acme-usage", deactivatedReason: null },
|
||||
...patch,
|
||||
};
|
||||
@@ -235,7 +237,7 @@ describe("getUsageRequest", () => {
|
||||
test("swallows IP logging failures and still returns usage", async () => {
|
||||
const { dependencies, mocks } = buildDeps({ ipLoggingError: new Error("ip write failed") });
|
||||
|
||||
const response = await requestUsage(dependencies, { "x-api-key": "valid-secret", "x-forwarded-for": "203.0.113.10, 10.0.0.1" });
|
||||
const response = await requestUsage(dependencies, { "x-api-key": "valid-secret", "cf-connecting-ip": "203.0.113.10" });
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
await expect(response.json()).resolves.toEqual({ plan: "" });
|
||||
|
||||
Reference in new issue
Block a user