Skip to content
File

Blob: src/worker/config.ts

typescript16 lines
1export interface AppConfig {
2 authSessionTtlSeconds: number;
3 authSessionRefreshThresholdSeconds: number;
4 sessionVersion: number;
5 appEncryptionKeyCurrentVersion: number;
6 appEncryptionKeysJson: string;
7}
8 
9export const getConfig = (env: Env): AppConfig => ({
10 authSessionTtlSeconds: Number(env.AUTH_SESSION_TTL_SECONDS),
11 authSessionRefreshThresholdSeconds: Number(env.AUTH_SESSION_REFRESH_THRESHOLD_SECONDS),
12 sessionVersion: Number(env.SESSION_VERSION),
13 appEncryptionKeyCurrentVersion: Number(env.APP_ENCRYPTION_KEY_CURRENT_VERSION),
14 appEncryptionKeysJson: env.APP_ENCRYPTION_KEYS_JSON,
15});