Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/minting-service/handlers/stripe-webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export default async function handler(req: VercelRequest, res: VercelResponse):
privateKeyHex: env.LICENSE_SIGNING_PRIVATE_KEY_HEX,
resendApiKey: env.RESEND_API_KEY,
emailFrom: env.EMAIL_FROM,
defaultTtlDays: env.LICENSE_DEFAULT_TTL_DAYS,
};

try {
Expand Down
8 changes: 1 addition & 7 deletions apps/minting-service/src/lib/env.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('loadEnv', () => {
const { loadEnv } = await import('./env.js');
const env = loadEnv();
expect(env.STRIPE_SECRET_KEY).toBe('sk_test_xxx');
expect(env.LICENSE_DEFAULT_TTL_DAYS).toBe(365);
expect(env.LICENSE_SIGNING_PRIVATE_KEY_HEX).toHaveLength(64);
});

it('throws with a list of all missing vars', async () => {
Expand All @@ -48,10 +48,4 @@ describe('loadEnv', () => {
expect(() => loadEnv()).toThrow(/64 hex chars/);
});

it('accepts a custom LICENSE_DEFAULT_TTL_DAYS', async () => {
setEnv({ ...REQUIRED, LICENSE_DEFAULT_TTL_DAYS: '30' });
const { loadEnv } = await import('./env.js');
const env = loadEnv();
expect(env.LICENSE_DEFAULT_TTL_DAYS).toBe(30);
});
});
2 changes: 0 additions & 2 deletions apps/minting-service/src/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export interface Env {
RESEND_API_KEY: string;
EMAIL_FROM: string;
LICENSE_SIGNING_PRIVATE_KEY_HEX: string;
LICENSE_DEFAULT_TTL_DAYS: number;
}

export function loadEnv(): Env {
Expand All @@ -36,6 +35,5 @@ export function loadEnv(): Env {
RESEND_API_KEY: process.env['RESEND_API_KEY']!,
EMAIL_FROM: process.env['EMAIL_FROM']!,
LICENSE_SIGNING_PRIVATE_KEY_HEX: keyHex,
LICENSE_DEFAULT_TTL_DAYS: Number(process.env['LICENSE_DEFAULT_TTL_DAYS'] ?? 365),
};
}
1 change: 0 additions & 1 deletion apps/minting-service/src/lib/handlers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function makeDeps(overrides: Partial<HandlerDeps> = {}): HandlerDeps {
privateKeyHex: 'a'.repeat(64),
resendApiKey: 're_test',
emailFrom: 'noreply@example.com',
defaultTtlDays: 365,
...overrides,
};
}
Expand Down
1 change: 0 additions & 1 deletion apps/minting-service/src/lib/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export interface HandlerDeps {
privateKeyHex: string;
resendApiKey: string;
emailFrom: string;
defaultTtlDays: number;
}

export async function handleEvent(event: Stripe.Event, deps: HandlerDeps): Promise<void> {
Expand Down