@authup/server-core 1.0.0-beta.47 → 1.0.0-beta.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/adapters/http/middleware/built-in/cors.d.ts.map +1 -1
  2. package/dist/adapters/http/middleware/built-in/cors.mjs.map +1 -1
  3. package/dist/app/index.mjs +2 -2
  4. package/dist/app/modules/config/constants.d.ts +1 -1
  5. package/dist/app/modules/config/constants.d.ts.map +1 -1
  6. package/dist/app/modules/config/constants.mjs +1 -1
  7. package/dist/app/modules/config/constants.mjs.map +1 -1
  8. package/dist/app/modules/config/index.mjs +2 -2
  9. package/dist/app/modules/config/module.d.ts +3 -3
  10. package/dist/app/modules/config/module.d.ts.map +1 -1
  11. package/dist/app/modules/config/module.mjs +2 -1
  12. package/dist/app/modules/config/module.mjs.map +1 -1
  13. package/dist/app/modules/config/normalize.d.ts +1 -1
  14. package/dist/app/modules/config/normalize.d.ts.map +1 -1
  15. package/dist/app/modules/config/normalize.mjs +9 -7
  16. package/dist/app/modules/config/normalize.mjs.map +1 -1
  17. package/dist/app/modules/config/origins.d.ts +19 -4
  18. package/dist/app/modules/config/origins.d.ts.map +1 -1
  19. package/dist/app/modules/config/origins.mjs +29 -6
  20. package/dist/app/modules/config/origins.mjs.map +1 -1
  21. package/dist/app/modules/config/parse.d.ts +1 -1
  22. package/dist/app/modules/config/parse.d.ts.map +1 -1
  23. package/dist/app/modules/config/parse.mjs +4 -49
  24. package/dist/app/modules/config/parse.mjs.map +1 -1
  25. package/dist/app/modules/config/read/env.mjs +3 -3
  26. package/dist/app/modules/config/read/env.mjs.map +1 -1
  27. package/dist/app/modules/config/types.d.ts +14 -6
  28. package/dist/app/modules/config/types.d.ts.map +1 -1
  29. package/dist/app/modules/config/validator.d.ts +6 -0
  30. package/dist/app/modules/config/validator.d.ts.map +1 -0
  31. package/dist/app/modules/config/validator.mjs +72 -0
  32. package/dist/app/modules/config/validator.mjs.map +1 -0
  33. package/dist/app/modules/http/modules/middleware.d.ts.map +1 -1
  34. package/dist/app/modules/http/modules/middleware.mjs +1 -4
  35. package/dist/app/modules/http/modules/middleware.mjs.map +1 -1
  36. package/dist/app/modules/index.mjs +2 -2
  37. package/dist/cli/module.mjs +1 -1
  38. package/dist/cli/module.mjs.map +1 -1
  39. package/dist/index.mjs +2 -2
  40. package/dist/ui/client/.vite/ssr-manifest.json +54 -0
  41. package/dist/ui/client/assets/{index-CgLTRwpP.js → index-BDM2dsWN.js} +19 -12
  42. package/dist/ui/client/index.html +1 -1
  43. package/dist/ui/server/server.js +1343 -511
  44. package/package.json +13 -13
@@ -1 +1 @@
1
- {"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/http/middleware/built-in/cors.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAElC,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,WAAW,QAuBtE"}
1
+ {"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../../../../src/adapters/http/middleware/built-in/cors.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAElC,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,WAAW,QA2BtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"cors.mjs","names":["cors","registerCorsMiddleware","router","input","use","origin","credentials","exposeHeaders"],"sources":["../../../../../src/adapters/http/middleware/built-in/cors.ts"],"sourcesContent":["/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Options as CorsOptions } from '@routup/cors';\nimport { cors } from '@routup/cors';\nimport type { App } from 'routup';\n\nexport function registerCorsMiddleware(router: App, input?: CorsOptions) {\n router.use(cors({\n // @routup/cors reflects the matched origin when given an array (and\n // still honours credentials: true). Callers pass the trusted\n // appOrigins allowlist; falls back to reflect-all only if unset.\n origin: true,\n credentials: true,\n // `credentials: true` is incompatible with the `*` wildcard for\n // exposeHeaders, so enumerate the response headers JS clients need.\n exposeHeaders: [\n 'ratelimit-limit',\n 'ratelimit-remaining',\n 'ratelimit-reset',\n 'retry-after',\n 'etag',\n 'content-disposition',\n 'content-range',\n 'accept-ranges',\n 'location',\n 'www-authenticate',\n ],\n ...(input ?? {}),\n }));\n}\n"],"mappings":";;;;;AAWA,SAAgBC,uBAAuBC,QAAaC,OAAmB;CACnED,OAAOE,IAAIJ,KAAK;EAIZK,QAAQ;EACRC,aAAa;EAGbC,eAAe;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;;EAEJ,GAAIJ,SAAS,CAAC;CAClB,CAAA,CAAA;AACJ"}
1
+ {"version":3,"file":"cors.mjs","names":["cors","registerCorsMiddleware","router","input","use","origin","credentials","exposeHeaders"],"sources":["../../../../../src/adapters/http/middleware/built-in/cors.ts"],"sourcesContent":["/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Options as CorsOptions } from '@routup/cors';\nimport { cors } from '@routup/cors';\nimport type { App } from 'routup';\n\nexport function registerCorsMiddleware(router: App, input?: CorsOptions) {\n router.use(cors({\n // Reflect any origin by default: OAuth2 clients (and their UIs) are\n // registered at runtime on arbitrary domains, so a startup-time\n // allowlist cannot know them. All authentication is header-based\n // (Bearer/Basic) — no cookie-authenticated endpoint exists — so an\n // origin allowlist would add no security, only break dynamically\n // registered browser clients. Operators can still pass an explicit\n // `origin` via the middlewareCors config options.\n origin: true,\n credentials: true,\n // `credentials: true` is incompatible with the `*` wildcard for\n // exposeHeaders, so enumerate the response headers JS clients need.\n exposeHeaders: [\n 'ratelimit-limit',\n 'ratelimit-remaining',\n 'ratelimit-reset',\n 'retry-after',\n 'etag',\n 'content-disposition',\n 'content-range',\n 'accept-ranges',\n 'location',\n 'www-authenticate',\n ],\n ...(input ?? {}),\n }));\n}\n"],"mappings":";;;;;AAWA,SAAgBC,uBAAuBC,QAAaC,OAAmB;CACnED,OAAOE,IAAIJ,KAAK;EAQZK,QAAQ;EACRC,aAAa;EAGbC,eAAe;GACX;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;;EAEJ,GAAIJ,SAAS,CAAC;CAClB,CAAA,CAAA;AACJ"}
@@ -5,8 +5,8 @@ import { AuthenticationInjectionKey } from "./modules/authentication/constants.m
5
5
  import { CacheInjectionKey } from "./modules/cache/constants.mjs";
6
6
  import { ModuleName } from "./modules/constants.mjs";
7
7
  import { ConfigEnvironmentVariableName, ConfigInjectionKey } from "./modules/config/constants.mjs";
8
+ import { expandToOrigins, getAppOrigins } from "./modules/config/origins.mjs";
8
9
  import { ConfigModule } from "./modules/config/module.mjs";
9
- import { getAppOrigins } from "./modules/config/origins.mjs";
10
10
  import { CacheModule } from "./modules/cache/module.mjs";
11
11
  import { SessionRepository } from "./modules/authentication/repositories/session.mjs";
12
12
  import { AuthenticationModule } from "./modules/authentication/module.mjs";
@@ -62,4 +62,4 @@ import { RuntimeModule } from "./modules/runtime/module.mjs";
62
62
  import "./modules/index.mjs";
63
63
  import { ApplicationBuilder } from "./builder.mjs";
64
64
  import { createApplication } from "./factory.mjs";
65
- export { ApplicationBuilder, AuthenticationInjectionKey, AuthenticationModule, CacheInjectionKey, CacheModule, ClientIdentityRepository, ClientPermissionRepositoryAdapter, ClientRepositoryAdapter, ClientRoleRepositoryAdapter, ClientScopeRepositoryAdapter, ComponentsModule, CompositeProvisioningSource, ConfigEnvironmentVariableName, ConfigInjectionKey, ConfigModule, DatabaseInjectionKey, DatabaseModule, DefaultProvisioningSource, FileProvisioningSource, HTTPInjectionKey, HTTPModule, IdentityInjectionKey, IdentityModule, IdentityProviderAccountRepository, IdentityProviderAttributeMappingRepository, IdentityProviderPermissionMappingRepository, IdentityProviderRepositoryAdapter, IdentityProviderRoleMappingRepository, IdentityProviderRoleMappingRepositoryAdapter, LDAPInjectionKey, LdapModule, LoggerInjectionKey, LoggerModule, MailInjectionKey, MailModule, MailTemplateRendererInjectionKey, ModuleName, OAuth2InjectionToken, OAuth2Module, PermissionDatabaseProvider, PermissionPolicyRepositoryAdapter, PermissionRepositoryAdapter, PolicyRepositoryAdapter, ProvisionerModule, RealmRepositoryAdapter, RobotIdentityRepository, RobotPermissionRepositoryAdapter, RobotRepositoryAdapter, RobotRoleRepositoryAdapter, RoleAttributeRepositoryAdapter, RolePermissionRepositoryAdapter, RoleRepositoryAdapter, RuntimeModule, ScopeRepositoryAdapter, SessionRepository, UserAttributeRepositoryAdapter, UserIdentityRepository, UserPermissionRepositoryAdapter, UserRepositoryAdapter, UserRoleRepositoryAdapter, createApplication, getAppOrigins };
65
+ export { ApplicationBuilder, AuthenticationInjectionKey, AuthenticationModule, CacheInjectionKey, CacheModule, ClientIdentityRepository, ClientPermissionRepositoryAdapter, ClientRepositoryAdapter, ClientRoleRepositoryAdapter, ClientScopeRepositoryAdapter, ComponentsModule, CompositeProvisioningSource, ConfigEnvironmentVariableName, ConfigInjectionKey, ConfigModule, DatabaseInjectionKey, DatabaseModule, DefaultProvisioningSource, FileProvisioningSource, HTTPInjectionKey, HTTPModule, IdentityInjectionKey, IdentityModule, IdentityProviderAccountRepository, IdentityProviderAttributeMappingRepository, IdentityProviderPermissionMappingRepository, IdentityProviderRepositoryAdapter, IdentityProviderRoleMappingRepository, IdentityProviderRoleMappingRepositoryAdapter, LDAPInjectionKey, LdapModule, LoggerInjectionKey, LoggerModule, MailInjectionKey, MailModule, MailTemplateRendererInjectionKey, ModuleName, OAuth2InjectionToken, OAuth2Module, PermissionDatabaseProvider, PermissionPolicyRepositoryAdapter, PermissionRepositoryAdapter, PolicyRepositoryAdapter, ProvisionerModule, RealmRepositoryAdapter, RobotIdentityRepository, RobotPermissionRepositoryAdapter, RobotRepositoryAdapter, RobotRoleRepositoryAdapter, RoleAttributeRepositoryAdapter, RolePermissionRepositoryAdapter, RoleRepositoryAdapter, RuntimeModule, ScopeRepositoryAdapter, SessionRepository, UserAttributeRepositoryAdapter, UserIdentityRepository, UserPermissionRepositoryAdapter, UserRepositoryAdapter, UserRoleRepositoryAdapter, createApplication, expandToOrigins, getAppOrigins };
@@ -9,7 +9,7 @@ export declare enum ConfigEnvironmentVariableName {
9
9
  HOST = "HOST",
10
10
  PORT = "PORT",
11
11
  PUBLIC_URL = "PUBLIC_URL",
12
- ADDITIONAL_DOMAINS = "ADDITIONAL_DOMAINS",
12
+ TRUSTED_ORIGINS = "TRUSTED_ORIGINS",
13
13
  TOKEN_ACCESS_MAX_AGE = "TOKEN_ACCESS_MAX_AGE",
14
14
  TOKEN_REFRESH_MAX_AGE = "TOKEN_REFRESH_MAX_AGE",
15
15
  REGISTRATION_ENABLED = "REGISTRATION_ENABLED",
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/constants.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,eAAO,MAAM,kBAAkB,oBAAmC,CAAC;AAEnE,oBAAY,6BAA6B;IACrC,QAAQ,aAAa;IACrB,uBAAuB,4BAA4B;IAEnD,KAAK,UAAU;IACf,IAAI,SAAS;IAEb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,kBAAkB,uBAAuB;IACzC,oBAAoB,yBAAyB;IAC7C,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,0BAA0B,+BAA+B;IACzD,yBAAyB,8BAA8B;IAEvD,iBAAiB,sBAAsB;IACvC,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,0BAA0B,+BAA+B;IAEzD,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,yBAAyB,8BAA8B;IAEvD,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;IACzC,wBAAwB,6BAA6B;IAErD,WAAW,gBAAgB;IAC3B,qCAAqC,0CAA0C;CAClF"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/constants.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,eAAO,MAAM,kBAAkB,oBAAmC,CAAC;AAEnE,oBAAY,6BAA6B;IACrC,QAAQ,aAAa;IACrB,uBAAuB,4BAA4B;IAEnD,KAAK,UAAU;IACf,IAAI,SAAS;IAEb,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,oBAAoB,yBAAyB;IAC7C,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,0BAA0B,+BAA+B;IACzD,yBAAyB,8BAA8B;IAEvD,iBAAiB,sBAAsB;IACvC,qBAAqB,0BAA0B;IAC/C,oBAAoB,yBAAyB;IAC7C,0BAA0B,+BAA+B;IAEzD,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,mBAAmB,wBAAwB;IAC3C,yBAAyB,8BAA8B;IAEvD,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;IACzC,wBAAwB,6BAA6B;IAErD,WAAW,gBAAgB;IAC3B,qCAAqC,0CAA0C;CAClF"}
@@ -12,7 +12,7 @@ var ConfigEnvironmentVariableName = /*#__PURE__*/ function(ConfigEnvironmentVari
12
12
  ConfigEnvironmentVariableName["HOST"] = "HOST";
13
13
  ConfigEnvironmentVariableName["PORT"] = "PORT";
14
14
  ConfigEnvironmentVariableName["PUBLIC_URL"] = "PUBLIC_URL";
15
- ConfigEnvironmentVariableName["ADDITIONAL_DOMAINS"] = "ADDITIONAL_DOMAINS";
15
+ ConfigEnvironmentVariableName["TRUSTED_ORIGINS"] = "TRUSTED_ORIGINS";
16
16
  ConfigEnvironmentVariableName["TOKEN_ACCESS_MAX_AGE"] = "TOKEN_ACCESS_MAX_AGE";
17
17
  ConfigEnvironmentVariableName["TOKEN_REFRESH_MAX_AGE"] = "TOKEN_REFRESH_MAX_AGE";
18
18
  ConfigEnvironmentVariableName["REGISTRATION_ENABLED"] = "REGISTRATION_ENABLED";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.mjs","names":["TypedToken","ConfigInjectionKey","ConfigEnvironmentVariableName"],"sources":["../../../../src/app/modules/config/constants.ts"],"sourcesContent":["/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { TypedToken } from 'eldin';\nimport type { Config } from './types.ts';\n\nexport const ConfigInjectionKey = new TypedToken<Config>('Config');\n\nexport enum ConfigEnvironmentVariableName {\n NODE_ENV = 'NODE_ENV',\n WRITABLE_DIRECTORY_PATH = 'WRITABLE_DIRECTORY_PATH',\n\n REDIS = 'REDIS',\n SMTP = 'SMTP',\n\n HOST = 'HOST',\n PORT = 'PORT',\n PUBLIC_URL = 'PUBLIC_URL',\n ADDITIONAL_DOMAINS = 'ADDITIONAL_DOMAINS',\n TOKEN_ACCESS_MAX_AGE = 'TOKEN_ACCESS_MAX_AGE',\n TOKEN_REFRESH_MAX_AGE = 'TOKEN_REFRESH_MAX_AGE',\n REGISTRATION_ENABLED = 'REGISTRATION_ENABLED',\n EMAIL_VERIFICATION_ENABLED = 'EMAIL_VERIFICATION_ENABLED',\n PASSWORD_RECOVERY_ENABLED = 'PASSWORD_RECOVERY_ENABLED',\n\n CLIENT_AUTH_BASIC = 'CLIENT_AUTH_BASIC',\n CLIENT_SYSTEM_ENABLED = 'CLIENT_SYSTEM_ENABLED',\n CLIENT_SYSTEM_SECRET = 'CLIENT_SYSTEM_SECRET',\n CLIENT_SYSTEM_SECRET_RESET = 'CLIENT_SYSTEM_SECRET_RESET',\n\n USER_AUTH_BASIC = 'USER_AUTH_BASIC',\n USER_ADMIN_ENABLED = 'USER_ADMIN_ENABLED',\n USER_ADMIN_PASSWORD = 'USER_ADMIN_PASSWORD',\n USER_ADMIN_PASSWORD_RESET = 'USER_ADMIN_PASSWORD_RESET',\n\n ROBOT_AUTH_BASIC = 'ROBOT_AUTH_BASIC',\n ROBOT_ADMIN_ENABLED = 'ROBOT_ADMIN_ENABLED',\n ROBOT_ADMIN_SECRET = 'ROBOT_ADMIN_SECRET',\n ROBOT_ADMIN_SECRET_RESET = 'ROBOT_ADMIN_SECRET_RESET',\n\n PERMISSIONS = 'PERMISSIONS',\n PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT = 'PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT',\n}\n"],"mappings":";;;;;AAUA,MAAaC,qBAAqB,IAAID,WAAmB,QAAA;AAEzD,IAAO,gCAAKE,uBAAAA,+BAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAAA"}
1
+ {"version":3,"file":"constants.mjs","names":["TypedToken","ConfigInjectionKey","ConfigEnvironmentVariableName"],"sources":["../../../../src/app/modules/config/constants.ts"],"sourcesContent":["/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { TypedToken } from 'eldin';\nimport type { Config } from './types.ts';\n\nexport const ConfigInjectionKey = new TypedToken<Config>('Config');\n\nexport enum ConfigEnvironmentVariableName {\n NODE_ENV = 'NODE_ENV',\n WRITABLE_DIRECTORY_PATH = 'WRITABLE_DIRECTORY_PATH',\n\n REDIS = 'REDIS',\n SMTP = 'SMTP',\n\n HOST = 'HOST',\n PORT = 'PORT',\n PUBLIC_URL = 'PUBLIC_URL',\n TRUSTED_ORIGINS = 'TRUSTED_ORIGINS',\n TOKEN_ACCESS_MAX_AGE = 'TOKEN_ACCESS_MAX_AGE',\n TOKEN_REFRESH_MAX_AGE = 'TOKEN_REFRESH_MAX_AGE',\n REGISTRATION_ENABLED = 'REGISTRATION_ENABLED',\n EMAIL_VERIFICATION_ENABLED = 'EMAIL_VERIFICATION_ENABLED',\n PASSWORD_RECOVERY_ENABLED = 'PASSWORD_RECOVERY_ENABLED',\n\n CLIENT_AUTH_BASIC = 'CLIENT_AUTH_BASIC',\n CLIENT_SYSTEM_ENABLED = 'CLIENT_SYSTEM_ENABLED',\n CLIENT_SYSTEM_SECRET = 'CLIENT_SYSTEM_SECRET',\n CLIENT_SYSTEM_SECRET_RESET = 'CLIENT_SYSTEM_SECRET_RESET',\n\n USER_AUTH_BASIC = 'USER_AUTH_BASIC',\n USER_ADMIN_ENABLED = 'USER_ADMIN_ENABLED',\n USER_ADMIN_PASSWORD = 'USER_ADMIN_PASSWORD',\n USER_ADMIN_PASSWORD_RESET = 'USER_ADMIN_PASSWORD_RESET',\n\n ROBOT_AUTH_BASIC = 'ROBOT_AUTH_BASIC',\n ROBOT_ADMIN_ENABLED = 'ROBOT_ADMIN_ENABLED',\n ROBOT_ADMIN_SECRET = 'ROBOT_ADMIN_SECRET',\n ROBOT_ADMIN_SECRET_RESET = 'ROBOT_ADMIN_SECRET_RESET',\n\n PERMISSIONS = 'PERMISSIONS',\n PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT = 'PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT',\n}\n"],"mappings":";;;;;AAUA,MAAaC,qBAAqB,IAAID,WAAmB,QAAA;AAEzD,IAAO,gCAAKE,uBAAAA,+BAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAAA"}
@@ -2,6 +2,6 @@ import "node:path";
2
2
  import "node:url";
3
3
  import.meta.url;
4
4
  import { ConfigEnvironmentVariableName, ConfigInjectionKey } from "./constants.mjs";
5
+ import { expandToOrigins, getAppOrigins } from "./origins.mjs";
5
6
  import { ConfigModule } from "./module.mjs";
6
- import { getAppOrigins } from "./origins.mjs";
7
- export { ConfigEnvironmentVariableName, ConfigInjectionKey, ConfigModule, getAppOrigins };
7
+ export { ConfigEnvironmentVariableName, ConfigInjectionKey, ConfigModule, expandToOrigins, getAppOrigins };
@@ -1,11 +1,11 @@
1
1
  import type { IModule } from 'orkos';
2
2
  import type { IContainer } from 'eldin';
3
3
  import type { ConfigRawReadOptions } from './read/index.ts';
4
- import type { Config } from './types.ts';
4
+ import type { Config, ConfigFactory } from './types.ts';
5
5
  export declare class ConfigModule implements IModule {
6
6
  readonly name: string;
7
- protected instance: Config | undefined;
8
- constructor(config?: Config);
7
+ protected instance: Config | ConfigFactory | undefined;
8
+ constructor(config?: Config | ConfigFactory);
9
9
  setup(container: IContainer): Promise<void>;
10
10
  /**
11
11
  * Read config from env and fs.
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,qBAAa,YAAa,YAAW,OAAO;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,SAAS,CAAC,QAAQ,EAAG,MAAM,GAAG,SAAS,CAAC;gBAI5B,MAAM,CAAC,EAAE,MAAM;IAOrB,KAAK,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAajD;;;;OAIG;IACG,IAAI,CAAC,OAAO,GAAE,oBAAyB,GAAI,OAAO,CAAC,MAAM,CAAC;CAQnE"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAExD,qBAAa,YAAa,YAAW,OAAO;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,SAAS,CAAC,QAAQ,EAAG,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;gBAI5C,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa;IAOrC,KAAK,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAejD;;;;OAIG;IACG,IAAI,CAAC,OAAO,GAAE,oBAAyB,GAAI,OAAO,CAAC,MAAM,CAAC;CAQnE"}
@@ -16,7 +16,8 @@ var ConfigModule = class {
16
16
  }
17
17
  async setup(container) {
18
18
  let instance;
19
- if (this.instance) instance = this.instance;
19
+ if (typeof this.instance === "function") instance = await this.instance();
20
+ else if (this.instance) instance = this.instance;
20
21
  else instance = await this.read();
21
22
  container.register(ConfigInjectionKey, { useValue: instance });
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"module.mjs","names":["ModuleName","ConfigInjectionKey","normalizeConfig","readConfigRaw","ConfigModule","name","instance","config","CONFIG","setup","container","read","register","useValue","options","raw","env"],"sources":["../../../../src/app/modules/config/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IModule } from 'orkos';\nimport { ModuleName } from '../constants.ts';\nimport { ConfigInjectionKey } from './constants.ts';\nimport type { IContainer } from 'eldin';\nimport { normalizeConfig } from './normalize.ts';\nimport type { ConfigRawReadOptions } from './read/index.ts';\nimport { readConfigRaw } from './read/index.ts';\nimport type { Config } from './types.ts';\n\nexport class ConfigModule implements IModule {\n readonly name: string;\n\n protected instance : Config | undefined;\n\n // ----------------------------------------------------\n\n constructor(config?: Config) {\n this.name = ModuleName.CONFIG;\n this.instance = config;\n }\n\n // ----------------------------------------------------\n\n async setup(container: IContainer): Promise<void> {\n let instance : Config;\n if (this.instance) {\n instance = this.instance;\n } else {\n instance = await this.read();\n }\n\n container.register(ConfigInjectionKey, { useValue: instance });\n }\n\n // ----------------------------------------------------\n\n /**\n * Read config from env and fs.\n *\n * @param options\n */\n async read(options: ConfigRawReadOptions = {}) : Promise<Config> {\n const raw = await readConfigRaw({\n env: true,\n ...options,\n });\n\n return normalizeConfig(raw);\n }\n}\n"],"mappings":";;;;;;;;;AAgBA,IAAaI,eAAb,MAAaA;CACAC;CAECC;CAIV,YAAYC,QAAiB;EACzB,KAAKF,OAAOL,WAAWQ;EACvB,KAAKF,WAAWC;CACpB;CAIA,MAAME,MAAMC,WAAsC;EAC9C,IAAIJ;EACJ,IAAI,KAAKA,UACLA,WAAW,KAAKA;OAEhBA,WAAW,MAAM,KAAKK,KAAI;EAG9BD,UAAUE,SAASX,oBAAoB,EAAEY,UAAUP,SAAS,CAAA;CAChE;;;;;IASA,MAAMK,KAAKG,UAAgC,CAAC,GAAqB;EAM7D,OAAOZ,gBAAgBa,MALLZ,cAAc;GAC5Ba,KAAK;GACL,GAAGF;EACP,CAAA,CAEuBC;CAC3B;AACJ"}
1
+ {"version":3,"file":"module.mjs","names":["ModuleName","ConfigInjectionKey","normalizeConfig","readConfigRaw","ConfigModule","name","instance","config","CONFIG","setup","container","read","register","useValue","options","raw","env"],"sources":["../../../../src/app/modules/config/module.ts"],"sourcesContent":["/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IModule } from 'orkos';\nimport { ModuleName } from '../constants.ts';\nimport { ConfigInjectionKey } from './constants.ts';\nimport type { IContainer } from 'eldin';\nimport { normalizeConfig } from './normalize.ts';\nimport type { ConfigRawReadOptions } from './read/index.ts';\nimport { readConfigRaw } from './read/index.ts';\nimport type { Config, ConfigFactory } from './types.ts';\n\nexport class ConfigModule implements IModule {\n readonly name: string;\n\n protected instance : Config | ConfigFactory | undefined;\n\n // ----------------------------------------------------\n\n constructor(config?: Config | ConfigFactory) {\n this.name = ModuleName.CONFIG;\n this.instance = config;\n }\n\n // ----------------------------------------------------\n\n async setup(container: IContainer): Promise<void> {\n let instance : Config;\n if (typeof this.instance === 'function') {\n instance = await this.instance();\n } else if (this.instance) {\n instance = this.instance;\n } else {\n instance = await this.read();\n }\n\n container.register(ConfigInjectionKey, { useValue: instance });\n }\n\n // ----------------------------------------------------\n\n /**\n * Read config from env and fs.\n *\n * @param options\n */\n async read(options: ConfigRawReadOptions = {}) : Promise<Config> {\n const raw = await readConfigRaw({\n env: true,\n ...options,\n });\n\n return normalizeConfig(raw);\n }\n}\n"],"mappings":";;;;;;;;;AAgBA,IAAaI,eAAb,MAAaA;CACAC;CAECC;CAIV,YAAYC,QAAiC;EACzC,KAAKF,OAAOL,WAAWQ;EACvB,KAAKF,WAAWC;CACpB;CAIA,MAAME,MAAMC,WAAsC;EAC9C,IAAIJ;EACJ,IAAI,OAAO,KAAKA,aAAa,YACzBA,WAAW,MAAM,KAAKA,SAAQ;OAC3B,IAAI,KAAKA,UACZA,WAAW,KAAKA;OAEhBA,WAAW,MAAM,KAAKK,KAAI;EAG9BD,UAAUE,SAASX,oBAAoB,EAAEY,UAAUP,SAAS,CAAA;CAChE;;;;;IASA,MAAMK,KAAKG,UAAgC,CAAC,GAAqB;EAM7D,OAAOZ,gBAAgBa,MALLZ,cAAc;GAC5Ba,KAAK;GACL,GAAGF;EACP,CAAA,CAEuBC;CAC3B;AACJ"}
@@ -1,3 +1,3 @@
1
1
  import type { Config, ConfigInput } from './types.ts';
2
- export declare function normalizeConfig(input?: ConfigInput): Config;
2
+ export declare function normalizeConfig(input?: ConfigInput): Promise<Config>;
3
3
  //# sourceMappingURL=normalize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/normalize.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAgB,eAAe,CAAC,KAAK,GAAE,WAAgB,GAAG,MAAM,CA0F/D"}
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/normalize.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAsB,eAAe,CAAC,KAAK,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqG9E"}
@@ -2,16 +2,17 @@ import "node:path";
2
2
  import "node:url";
3
3
  import.meta.url;
4
4
  import { toPublicHost } from "../../../utils/host.mjs";
5
+ import { expandToOrigins } from "./origins.mjs";
5
6
  import { parseConfig } from "./parse.mjs";
6
7
  import { EnvironmentName } from "@authup/kit";
7
8
  import { read } from "envix";
8
9
  import path from "node:path";
9
10
  import process from "node:process";
10
11
  //#region src/app/modules/config/normalize.ts
11
- function normalizeConfig(input = {}) {
12
- const parsed = parseConfig(input);
12
+ async function normalizeConfig(input = {}) {
13
+ const parsed = await parseConfig(input);
13
14
  const writableDirectoryPath = parsed.writableDirectoryPath || path.join(process.cwd(), "writable");
14
- const port = parsed.port || 3001;
15
+ const port = parsed.port ?? 3001;
15
16
  let host = parsed.host || "0.0.0.0";
16
17
  let publicUrl;
17
18
  if (parsed.publicUrl) publicUrl = parsed.publicUrl;
@@ -22,11 +23,12 @@ function normalizeConfig(input = {}) {
22
23
  publicUrl = `http://${toPublicHost(host)}:${match[2] || port}`;
23
24
  } else publicUrl = `http://${toPublicHost(host)}:${port}`;
24
25
  }
25
- const env = read("NODE_ENV", EnvironmentName.DEVELOPMENT);
26
- const additionalDomains = [...parsed.additionalDomains ?? []];
26
+ const env = parsed.env || read("NODE_ENV", EnvironmentName.DEVELOPMENT);
27
+ const trustedOrigins = [];
28
+ for (const value of parsed.trustedOrigins ?? []) for (const origin of expandToOrigins(value)) if (!trustedOrigins.includes(origin)) trustedOrigins.push(origin);
27
29
  if (env !== EnvironmentName.PRODUCTION) {
28
30
  const devOrigin = "http://localhost:3000";
29
- if (!additionalDomains.includes(devOrigin)) additionalDomains.push(devOrigin);
31
+ if (!trustedOrigins.includes(devOrigin)) trustedOrigins.push(devOrigin);
30
32
  }
31
33
  return {
32
34
  env,
@@ -65,7 +67,7 @@ function normalizeConfig(input = {}) {
65
67
  permissions: [],
66
68
  permissionsDefaultPolicyAssignment: true,
67
69
  ...parsed,
68
- additionalDomains
70
+ trustedOrigins
69
71
  };
70
72
  }
71
73
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.mjs","names":["read","path","process","EnvironmentName","toPublicHost","parseConfig","normalizeConfig","input","parsed","writableDirectoryPath","join","cwd","port","host","publicUrl","regex","match","env","DEVELOPMENT","additionalDomains","PRODUCTION","devOrigin","includes","push","rootPath","logger","redis","smtp","middlewareBody","middlewareCookie","middlewareCors","middlewarePrometheus","middlewareQuery","middlewareRateLimit","middlewareSwagger","tokenRefreshMaxAge","tokenAccessMaxAge","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","clientAuthBasic","clientSystemEnabled","clientSystemSecret","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","robotAuthBasic","robotAdminEnabled","robotAdminSecret","robotAdminSecretReset","permissions","permissionsDefaultPolicyAssignment"],"sources":["../../../../src/app/modules/config/normalize.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { read } from 'envix';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { EnvironmentName } from '@authup/kit';\nimport { toPublicHost } from '../../../utils/host.ts';\nimport { parseConfig } from './parse.ts';\nimport type { Config, ConfigInput } from './types.ts';\n\nexport function normalizeConfig(input: ConfigInput = {}): Config {\n const parsed = parseConfig(input);\n\n const writableDirectoryPath = parsed.writableDirectoryPath ||\n path.join(process.cwd(), 'writable');\n\n const port = parsed.port || 3001;\n let host = parsed.host || '0.0.0.0';\n\n let publicUrl : string;\n if (parsed.publicUrl) {\n publicUrl = parsed.publicUrl;\n } else {\n const regex = /^([^:]+)(?::(\\d+))?$/;\n const match = host.match(regex);\n if (match) {\n [, host] = match;\n publicUrl = `http://${toPublicHost(host)}:${match[2] || port}`;\n } else {\n publicUrl = `http://${toPublicHost(host)}:${port}`;\n }\n }\n\n const env = read('NODE_ENV', EnvironmentName.DEVELOPMENT);\n\n // In non-production (development & test) client-web runs on :3000 while\n // the API (publicUrl) runs on :3001. Seed :3000 into the trusted origins\n // so the redirect allowlist (<origin>/**) and CORS accept logins from the\n // dev UI out of the box; otherwise the realm-selection login is dead on\n // first run.\n // Copy — never mutate the caller-supplied parsed array in place, or a\n // repeated normalizeConfig() on the same input accumulates the dev origin\n // into a security-sensitive allowlist.\n const additionalDomains = [...(parsed.additionalDomains ?? [])];\n if (env !== EnvironmentName.PRODUCTION) {\n const devOrigin = 'http://localhost:3000';\n if (!additionalDomains.includes(devOrigin)) {\n additionalDomains.push(devOrigin);\n }\n }\n\n return {\n env,\n rootPath: process.cwd(),\n writableDirectoryPath,\n\n logger: true,\n redis: false,\n smtp: false,\n\n port,\n host,\n publicUrl,\n\n middlewareBody: true,\n middlewareCookie: true,\n middlewareCors: true,\n middlewarePrometheus: true,\n middlewareQuery: true,\n middlewareRateLimit: true,\n middlewareSwagger: true,\n tokenRefreshMaxAge: 259_200,\n tokenAccessMaxAge: 3_600,\n registrationEnabled: false,\n emailVerificationEnabled: false,\n passwordRecoveryEnabled: false,\n\n clientAuthBasic: false,\n clientSystemEnabled: false,\n clientSystemSecret: 'start123',\n clientSystemSecretReset: false,\n\n userAuthBasic: false,\n userAdminEnabled: true,\n userAdminPassword: 'start123',\n userAdminPasswordReset: false,\n\n robotAuthBasic: false,\n robotAdminEnabled: false,\n robotAdminSecret: 'start123',\n robotAdminSecretReset: false,\n\n permissions: [],\n permissionsDefaultPolicyAssignment: true,\n ...parsed,\n\n // After the spread so the dev-seeded value wins over the raw\n // parsed list (parsed.additionalDomains is already merged in above).\n additionalDomains,\n };\n}\n"],"mappings":";;;;;;;;;;AAeA,SAAgBM,gBAAgBC,QAAqB,CAAC,GAAC;CACnD,MAAMC,SAASH,YAAYE,KAAAA;CAE3B,MAAME,wBAAwBD,OAAOC,yBACjCR,KAAKS,KAAKR,QAAQS,IAAG,GAAI,UAAA;CAE7B,MAAMC,OAAOJ,OAAOI,QAAQ;CAC5B,IAAIC,OAAOL,OAAOK,QAAQ;CAE1B,IAAIC;CACJ,IAAIN,OAAOM,WACPA,YAAYN,OAAOM;MAChB;EAEH,MAAME,QAAQH,KAAKG,MAAMD,sBAAAA;EACzB,IAAIC,OAAO;GACP,GAAGH,QAAQG;GACXF,YAAY,UAAUV,aAAaS,IAAAA,EAAM,GAAGG,MAAM,MAAMJ;EAC5D,OACIE,YAAY,UAAUV,aAAaS,IAAAA,EAAM,GAAGD;CAEpD;CAEA,MAAMK,MAAMjB,KAAK,YAAYG,gBAAgBe,WAAW;CAUxD,MAAMC,oBAAoB,CAAA,GAAKX,OAAOW,qBAAqB,CAAA,CAAA;CAC3D,IAAIF,QAAQd,gBAAgBiB,YAAY;EACpC,MAAMC,YAAY;EAClB,IAAI,CAACF,kBAAkBG,SAASD,SAAAA,GAC5BF,kBAAkBI,KAAKF,SAAAA;CAE/B;CAEA,OAAO;EACHJ;EACAO,UAAUtB,QAAQS,IAAG;EACrBF;EAEAgB,QAAQ;EACRC,OAAO;EACPC,MAAM;EAENf;EACAC;EACAC;EAEAc,gBAAgB;EAChBC,kBAAkB;EAClBC,gBAAgB;EAChBC,sBAAsB;EACtBC,iBAAiB;EACjBC,qBAAqB;EACrBC,mBAAmB;EACnBC,oBAAoB;EACpBC,mBAAmB;EACnBC,qBAAqB;EACrBC,0BAA0B;EAC1BC,yBAAyB;EAEzBC,iBAAiB;EACjBC,qBAAqB;EACrBC,oBAAoB;EACpBC,yBAAyB;EAEzBC,eAAe;EACfC,kBAAkB;EAClBC,mBAAmB;EACnBC,wBAAwB;EAExBC,gBAAgB;EAChBC,mBAAmB;EACnBC,kBAAkB;EAClBC,uBAAuB;EAEvBC,aAAa,CAAA;EACbC,oCAAoC;EACpC,GAAG7C;EAIHW;CACJ;AACJ"}
1
+ {"version":3,"file":"normalize.mjs","names":["read","path","process","EnvironmentName","toPublicHost","expandToOrigins","parseConfig","normalizeConfig","input","parsed","writableDirectoryPath","join","cwd","port","host","publicUrl","regex","match","env","DEVELOPMENT","trustedOrigins","value","origin","includes","push","PRODUCTION","devOrigin","rootPath","logger","redis","smtp","middlewareBody","middlewareCookie","middlewareCors","middlewarePrometheus","middlewareQuery","middlewareRateLimit","middlewareSwagger","tokenRefreshMaxAge","tokenAccessMaxAge","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","clientAuthBasic","clientSystemEnabled","clientSystemSecret","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","robotAuthBasic","robotAdminEnabled","robotAdminSecret","robotAdminSecretReset","permissions","permissionsDefaultPolicyAssignment"],"sources":["../../../../src/app/modules/config/normalize.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { read } from 'envix';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { EnvironmentName } from '@authup/kit';\nimport { toPublicHost } from '../../../utils/host.ts';\nimport { expandToOrigins } from './origins.ts';\nimport { parseConfig } from './parse.ts';\nimport type { Config, ConfigInput } from './types.ts';\n\nexport async function normalizeConfig(input: ConfigInput = {}): Promise<Config> {\n const parsed = await parseConfig(input);\n\n const writableDirectoryPath = parsed.writableDirectoryPath ||\n path.join(process.cwd(), 'writable');\n\n const port = parsed.port ?? 3001;\n let host = parsed.host || '0.0.0.0';\n\n let publicUrl : string;\n if (parsed.publicUrl) {\n publicUrl = parsed.publicUrl;\n } else {\n const regex = /^([^:]+)(?::(\\d+))?$/;\n const match = host.match(regex);\n if (match) {\n [, host] = match;\n publicUrl = `http://${toPublicHost(host)}:${match[2] || port}`;\n } else {\n publicUrl = `http://${toPublicHost(host)}:${port}`;\n }\n }\n\n const env = parsed.env || read('NODE_ENV', EnvironmentName.DEVELOPMENT);\n\n // Canonicalize to bare origins (scheme://host[:port]) — a scheme-less\n // entry (e.g. `hub.local`) expands to both its http and https origin.\n // Downstream consumers (redirect allowlist, getAppOrigins) can rely on\n // every entry being a full origin. Building a fresh array also keeps a\n // repeated normalizeConfig() on the same input from accumulating the\n // dev origin into a security-sensitive allowlist.\n const trustedOrigins: string[] = [];\n for (const value of parsed.trustedOrigins ?? []) {\n for (const origin of expandToOrigins(value)) {\n if (!trustedOrigins.includes(origin)) {\n trustedOrigins.push(origin);\n }\n }\n }\n\n // In non-production (development & test) client-web runs on :3000 while\n // the API (publicUrl) runs on :3001. Seed :3000 into the trusted origins\n // so the redirect allowlist (<origin>/**) and CORS accept logins from the\n // dev UI out of the box; otherwise the realm-selection login is dead on\n // first run.\n if (env !== EnvironmentName.PRODUCTION) {\n const devOrigin = 'http://localhost:3000';\n if (!trustedOrigins.includes(devOrigin)) {\n trustedOrigins.push(devOrigin);\n }\n }\n\n return {\n env,\n rootPath: process.cwd(),\n writableDirectoryPath,\n\n logger: true,\n redis: false,\n smtp: false,\n\n port,\n host,\n publicUrl,\n\n middlewareBody: true,\n middlewareCookie: true,\n middlewareCors: true,\n middlewarePrometheus: true,\n middlewareQuery: true,\n middlewareRateLimit: true,\n middlewareSwagger: true,\n tokenRefreshMaxAge: 259_200,\n tokenAccessMaxAge: 3_600,\n registrationEnabled: false,\n emailVerificationEnabled: false,\n passwordRecoveryEnabled: false,\n\n clientAuthBasic: false,\n clientSystemEnabled: false,\n clientSystemSecret: 'start123',\n clientSystemSecretReset: false,\n\n userAuthBasic: false,\n userAdminEnabled: true,\n userAdminPassword: 'start123',\n userAdminPasswordReset: false,\n\n robotAuthBasic: false,\n robotAdminEnabled: false,\n robotAdminSecret: 'start123',\n robotAdminSecretReset: false,\n\n permissions: [],\n permissionsDefaultPolicyAssignment: true,\n ...parsed,\n\n // After the spread so the canonicalized + dev-seeded list wins over\n // the raw parsed list (parsed.trustedOrigins is merged in above).\n trustedOrigins,\n };\n}\n"],"mappings":";;;;;;;;;;;AAgBA,eAAsBO,gBAAgBC,QAAqB,CAAC,GAAC;CACzD,MAAMC,SAAS,MAAMH,YAAYE,KAAAA;CAEjC,MAAME,wBAAwBD,OAAOC,yBACjCT,KAAKU,KAAKT,QAAQU,IAAG,GAAI,UAAA;CAE7B,MAAMC,OAAOJ,OAAOI,QAAQ;CAC5B,IAAIC,OAAOL,OAAOK,QAAQ;CAE1B,IAAIC;CACJ,IAAIN,OAAOM,WACPA,YAAYN,OAAOM;MAChB;EAEH,MAAME,QAAQH,KAAKG,MAAMD,sBAAAA;EACzB,IAAIC,OAAO;GACP,GAAGH,QAAQG;GACXF,YAAY,UAAUX,aAAaU,IAAAA,EAAM,GAAGG,MAAM,MAAMJ;EAC5D,OACIE,YAAY,UAAUX,aAAaU,IAAAA,EAAM,GAAGD;CAEpD;CAEA,MAAMK,MAAMT,OAAOS,OAAOlB,KAAK,YAAYG,gBAAgBgB,WAAW;CAQtE,MAAMC,iBAA2B,CAAA;CACjC,KAAK,MAAMC,SAASZ,OAAOW,kBAAkB,CAAA,GACzC,KAAK,MAAME,UAAUjB,gBAAgBgB,KAAAA,GACjC,IAAI,CAACD,eAAeG,SAASD,MAAAA,GACzBF,eAAeI,KAAKF,MAAAA;CAUhC,IAAIJ,QAAQf,gBAAgBsB,YAAY;EACpC,MAAMC,YAAY;EAClB,IAAI,CAACN,eAAeG,SAASG,SAAAA,GACzBN,eAAeI,KAAKE,SAAAA;CAE5B;CAEA,OAAO;EACHR;EACAS,UAAUzB,QAAQU,IAAG;EACrBF;EAEAkB,QAAQ;EACRC,OAAO;EACPC,MAAM;EAENjB;EACAC;EACAC;EAEAgB,gBAAgB;EAChBC,kBAAkB;EAClBC,gBAAgB;EAChBC,sBAAsB;EACtBC,iBAAiB;EACjBC,qBAAqB;EACrBC,mBAAmB;EACnBC,oBAAoB;EACpBC,mBAAmB;EACnBC,qBAAqB;EACrBC,0BAA0B;EAC1BC,yBAAyB;EAEzBC,iBAAiB;EACjBC,qBAAqB;EACrBC,oBAAoB;EACpBC,yBAAyB;EAEzBC,eAAe;EACfC,kBAAkB;EAClBC,mBAAmB;EACnBC,wBAAwB;EAExBC,gBAAgB;EAChBC,mBAAmB;EACnBC,kBAAkB;EAClBC,uBAAuB;EAEvBC,aAAa,CAAA;EACbC,oCAAoC;EACpC,GAAG/C;EAIHW;CACJ;AACJ"}
@@ -1,10 +1,25 @@
1
1
  import type { Config } from './types.ts';
2
+ /**
3
+ * Expand a configured trusted-origin value to its canonical origin(s).
4
+ *
5
+ * A value with an explicit scheme contributes exactly that origin —
6
+ * the way to restrict a host to https only. A bare host[:port]
7
+ * (e.g. `hub.local`) contributes both the http and https origin.
8
+ *
9
+ * Only http(s) is accepted: other schemes either have no usable web
10
+ * origin (`new URL('myapp://x').origin` is the literal string "null")
11
+ * or are meaningless as a redirect target for the web client — letting
12
+ * them through would put garbage into a security-sensitive allowlist.
13
+ *
14
+ * Throws on values that don't parse as a URL/host or use another scheme.
15
+ */
16
+ export declare function expandToOrigins(value: string): string[];
2
17
  /**
3
18
  * Derive the set of trusted application origins (scheme://host[:port]).
4
19
  *
5
- * publicUrl may carry a path; both the OAuth2 redirect allowlist and the
6
- * CORS origin allowlist need bare origins, so extract the origin from each
7
- * configured URL and de-duplicate.
20
+ * publicUrl may carry a path, so its origin is extracted; trustedOrigins
21
+ * entries are canonical origins normalizeConfig owns that invariant
22
+ * (expansion + dedupe via expandToOrigins) — and are merged verbatim.
8
23
  */
9
- export declare function getAppOrigins(config: Pick<Config, 'publicUrl' | 'additionalDomains'>): string[];
24
+ export declare function getAppOrigins(config: Pick<Config, 'publicUrl' | 'trustedOrigins'>): string[];
10
25
  //# sourceMappingURL=origins.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"origins.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/origins.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,GAAG,mBAAmB,CAAC,GAAG,MAAM,EAAE,CAS/F"}
1
+ {"version":3,"file":"origins.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/origins.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAMzC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAcvD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,GAAG,gBAAgB,CAAC,GAAG,MAAM,EAAE,CAS5F"}
@@ -3,19 +3,42 @@ import "node:url";
3
3
  import.meta.url;
4
4
  import { URL } from "node:url";
5
5
  //#region src/app/modules/config/origins.ts
6
+ const SCHEME_REGEX = /^[a-z][a-z0-9+.-]*:\/\//i;
7
+ const ALLOWED_PROTOCOLS = ["http:", "https:"];
8
+ /**
9
+ * Expand a configured trusted-origin value to its canonical origin(s).
10
+ *
11
+ * A value with an explicit scheme contributes exactly that origin —
12
+ * the way to restrict a host to https only. A bare host[:port]
13
+ * (e.g. `hub.local`) contributes both the http and https origin.
14
+ *
15
+ * Only http(s) is accepted: other schemes either have no usable web
16
+ * origin (`new URL('myapp://x').origin` is the literal string "null")
17
+ * or are meaningless as a redirect target for the web client — letting
18
+ * them through would put garbage into a security-sensitive allowlist.
19
+ *
20
+ * Throws on values that don't parse as a URL/host or use another scheme.
21
+ */ function expandToOrigins(value) {
22
+ if (SCHEME_REGEX.test(value)) {
23
+ const url = new URL(value);
24
+ if (!ALLOWED_PROTOCOLS.includes(url.protocol)) throw new Error(`A trusted origin must use the http or https protocol, got: ${url.protocol}`);
25
+ return [url.origin];
26
+ }
27
+ return [new URL(`http://${value}`).origin, new URL(`https://${value}`).origin];
28
+ }
6
29
  /**
7
30
  * Derive the set of trusted application origins (scheme://host[:port]).
8
31
  *
9
- * publicUrl may carry a path; both the OAuth2 redirect allowlist and the
10
- * CORS origin allowlist need bare origins, so extract the origin from each
11
- * configured URL and de-duplicate.
32
+ * publicUrl may carry a path, so its origin is extracted; trustedOrigins
33
+ * entries are canonical origins normalizeConfig owns that invariant
34
+ * (expansion + dedupe via expandToOrigins) — and are merged verbatim.
12
35
  */ function getAppOrigins(config) {
13
- const urls = [config.publicUrl, ...config.additionalDomains ?? []];
14
36
  const origins = /* @__PURE__ */ new Set();
15
- for (const url of urls) origins.add(new URL(url).origin);
37
+ origins.add(new URL(config.publicUrl).origin);
38
+ for (const origin of config.trustedOrigins ?? []) origins.add(origin);
16
39
  return Array.from(origins);
17
40
  }
18
41
  //#endregion
19
- export { getAppOrigins };
42
+ export { expandToOrigins, getAppOrigins };
20
43
 
21
44
  //# sourceMappingURL=origins.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"origins.mjs","names":["URL","getAppOrigins","config","urls","publicUrl","additionalDomains","origins","Set","url","add","origin","Array","from"],"sources":["../../../../src/app/modules/config/origins.ts"],"sourcesContent":["/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { URL } from 'node:url';\nimport type { Config } from './types.ts';\n\n/**\n * Derive the set of trusted application origins (scheme://host[:port]).\n *\n * publicUrl may carry a path; both the OAuth2 redirect allowlist and the\n * CORS origin allowlist need bare origins, so extract the origin from each\n * configured URL and de-duplicate.\n */\nexport function getAppOrigins(config: Pick<Config, 'publicUrl' | 'additionalDomains'>): string[] {\n const urls = [config.publicUrl, ...(config.additionalDomains ?? [])];\n\n const origins = new Set<string>();\n for (const url of urls) {\n origins.add(new URL(url).origin);\n }\n\n return Array.from(origins);\n}\n"],"mappings":";;;;;;;;;;;GAiBA,SAAgBC,cAAcC,QAAuD;CACjF,MAAMC,OAAO,CAACD,OAAOE,WAAAA,GAAeF,OAAOG,qBAAqB,CAAA,CAAA;CAEhE,MAAMC,0BAAU,IAAIC,IAAAA;CACpB,KAAK,MAAMC,OAAOL,MACdG,QAAQG,IAAI,IAAIT,IAAIQ,GAAAA,CAAAA,CAAKE,MAAM;CAGnC,OAAOC,MAAMC,KAAKN,OAAAA;AACtB"}
1
+ {"version":3,"file":"origins.mjs","names":["URL","SCHEME_REGEX","ALLOWED_PROTOCOLS","expandToOrigins","value","test","url","includes","protocol","Error","origin","getAppOrigins","config","origins","Set","add","publicUrl","trustedOrigins","Array","from"],"sources":["../../../../src/app/modules/config/origins.ts"],"sourcesContent":["/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { URL } from 'node:url';\nimport type { Config } from './types.ts';\n\nconst SCHEME_REGEX = /^[a-z][a-z0-9+.-]*:\\/\\//i;\n\nconst ALLOWED_PROTOCOLS = ['http:', 'https:'];\n\n/**\n * Expand a configured trusted-origin value to its canonical origin(s).\n *\n * A value with an explicit scheme contributes exactly that origin —\n * the way to restrict a host to https only. A bare host[:port]\n * (e.g. `hub.local`) contributes both the http and https origin.\n *\n * Only http(s) is accepted: other schemes either have no usable web\n * origin (`new URL('myapp://x').origin` is the literal string \"null\")\n * or are meaningless as a redirect target for the web client — letting\n * them through would put garbage into a security-sensitive allowlist.\n *\n * Throws on values that don't parse as a URL/host or use another scheme.\n */\nexport function expandToOrigins(value: string): string[] {\n if (SCHEME_REGEX.test(value)) {\n const url = new URL(value);\n if (!ALLOWED_PROTOCOLS.includes(url.protocol)) {\n throw new Error(`A trusted origin must use the http or https protocol, got: ${url.protocol}`);\n }\n\n return [url.origin];\n }\n\n return [\n new URL(`http://${value}`).origin,\n new URL(`https://${value}`).origin,\n ];\n}\n\n/**\n * Derive the set of trusted application origins (scheme://host[:port]).\n *\n * publicUrl may carry a path, so its origin is extracted; trustedOrigins\n * entries are canonical origins normalizeConfig owns that invariant\n * (expansion + dedupe via expandToOrigins) — and are merged verbatim.\n */\nexport function getAppOrigins(config: Pick<Config, 'publicUrl' | 'trustedOrigins'>): string[] {\n const origins = new Set<string>();\n origins.add(new URL(config.publicUrl).origin);\n\n for (const origin of config.trustedOrigins ?? []) {\n origins.add(origin);\n }\n\n return Array.from(origins);\n}\n"],"mappings":";;;;;AAUA,MAAMC,eAAe;AAErB,MAAMC,oBAAoB,CAAC,SAAS,QAAA;;;;;;;;;;;;;;GAgBpC,SAAgBC,gBAAgBC,OAAa;CACzC,IAAIH,aAAaI,KAAKD,KAAAA,GAAQ;EAC1B,MAAME,MAAM,IAAIN,IAAII,KAAAA;EACpB,IAAI,CAACF,kBAAkBK,SAASD,IAAIE,QAAQ,GACxC,MAAM,IAAIC,MAAM,8DAA8DH,IAAIE,UAAU;EAGhG,OAAO,CAACF,IAAII,MAAAA;CAChB;CAEA,OAAO,CACH,IAAIV,IAAI,UAAUI,OAAO,CAAA,CAAEM,QAC3B,IAAIV,IAAI,WAAWI,OAAO,CAAA,CAAEM,MAAAA;AAEpC;;;;;;;GASA,SAAgBC,cAAcC,QAAoD;CAC9E,MAAMC,0BAAU,IAAIC,IAAAA;CACpBD,QAAQE,IAAI,IAAIf,IAAIY,OAAOI,SAAS,CAAA,CAAEN,MAAM;CAE5C,KAAK,MAAMA,UAAUE,OAAOK,kBAAkB,CAAA,GAC1CJ,QAAQE,IAAIL,MAAAA;CAGhB,OAAOQ,MAAMC,KAAKN,OAAAA;AACtB"}
@@ -1,3 +1,3 @@
1
1
  import type { ConfigInput } from './types.ts';
2
- export declare function parseConfig(input?: unknown): ConfigInput;
2
+ export declare function parseConfig(input?: unknown): Promise<ConfigInput>;
3
3
  //# sourceMappingURL=parse.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/parse.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAU,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtD,wBAAgB,WAAW,CAAC,KAAK,GAAE,OAAY,GAAG,WAAW,CA6E5D"}
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/parse.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG9C,wBAAsB,WAAW,CAAC,KAAK,GAAE,OAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAQ3E"}
@@ -1,57 +1,12 @@
1
1
  import "node:path";
2
2
  import "node:url";
3
3
  import.meta.url;
4
+ import { ConfigValidator } from "./validator.mjs";
4
5
  import { isObject } from "@authup/kit";
5
- import zod from "zod";
6
6
  //#region src/app/modules/config/parse.ts
7
- function parseConfig(input = {}) {
8
- return zod.object({
9
- env: zod.string().optional(),
10
- rootPath: zod.string().optional(),
11
- writableDirectoryPath: zod.string().optional(),
12
- logger: zod.boolean().optional(),
13
- db: zod.custom((value) => isObject(value)).optional(),
14
- redis: zod.lazy(() => zod.union([
15
- zod.string().optional(),
16
- zod.boolean().optional(),
17
- zod.any().optional()
18
- ])).optional(),
19
- smtp: zod.lazy(() => zod.union([
20
- zod.string().optional(),
21
- zod.boolean().optional(),
22
- zod.any().optional()
23
- ])).optional(),
24
- port: zod.number().nonnegative().optional(),
25
- host: zod.string().optional(),
26
- publicUrl: zod.string().url().optional(),
27
- additionalDomains: zod.array(zod.string().url()).optional(),
28
- middlewareBody: zod.boolean().or(zod.record(zod.string(), zod.any())).optional(),
29
- middlewareCors: zod.boolean().or(zod.record(zod.string(), zod.any())).optional(),
30
- middlewareCookie: zod.boolean().or(zod.record(zod.string(), zod.any())).optional(),
31
- middlewareQuery: zod.boolean().or(zod.record(zod.string(), zod.any())).optional(),
32
- middlewarePrometheus: zod.boolean().or(zod.record(zod.string(), zod.any())).optional(),
33
- middlewareRateLimit: zod.boolean().or(zod.record(zod.string(), zod.any())).optional(),
34
- middlewareSwagger: zod.boolean().optional(),
35
- tokenAccessMaxAge: zod.number().nonnegative().optional(),
36
- tokenRefreshMaxAge: zod.number().nonnegative().optional(),
37
- registrationEnabled: zod.boolean().optional(),
38
- emailVerificationEnabled: zod.boolean().optional(),
39
- passwordRecoveryEnabled: zod.boolean().optional(),
40
- clientAuthBasic: zod.boolean().optional(),
41
- clientSystemEnabled: zod.boolean().optional(),
42
- clientSystemSecret: zod.string().min(3).max(256).optional(),
43
- clientSystemSecretReset: zod.boolean().optional(),
44
- userAuthBasic: zod.boolean().optional(),
45
- userAdminEnabled: zod.boolean().optional(),
46
- userAdminPassword: zod.string().min(3).max(256).optional(),
47
- userAdminPasswordReset: zod.boolean().optional(),
48
- robotAuthBasic: zod.boolean().optional(),
49
- robotAdminEnabled: zod.boolean().optional(),
50
- robotAdminSecret: zod.string().min(3).max(256).optional(),
51
- robotAdminSecretReset: zod.boolean().optional(),
52
- permissions: zod.string().or(zod.array(zod.string())).optional(),
53
- permissionsDefaultPolicyAssignment: zod.boolean().optional()
54
- }).parse(input);
7
+ async function parseConfig(input = {}) {
8
+ if (!isObject(input)) throw new Error("The configuration input must be an object.");
9
+ return new ConfigValidator().run(input);
55
10
  }
56
11
  //#endregion
57
12
  export { parseConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"parse.mjs","names":["isObject","zod","parseConfig","input","schema","object","env","string","optional","rootPath","writableDirectoryPath","logger","boolean","db","custom","value","redis","lazy","union","any","smtp","port","number","nonnegative","host","publicUrl","url","additionalDomains","array","middlewareBody","or","record","middlewareCors","middlewareCookie","middlewareQuery","middlewarePrometheus","middlewareRateLimit","middlewareSwagger","tokenAccessMaxAge","tokenRefreshMaxAge","registrationEnabled","emailVerificationEnabled","passwordRecoveryEnabled","clientAuthBasic","clientSystemEnabled","clientSystemSecret","min","max","clientSystemSecretReset","userAuthBasic","userAdminEnabled","userAdminPassword","userAdminPasswordReset","robotAuthBasic","robotAdminEnabled","robotAdminSecret","robotAdminSecretReset","permissions","permissionsDefaultPolicyAssignment","parse"],"sources":["../../../../src/app/modules/config/parse.ts"],"sourcesContent":["/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information.optional(),\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isObject } from '@authup/kit';\nimport type { BetterSqlite3ConnectionOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js';\nimport type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions.js';\nimport type { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions.js';\nimport zod from 'zod';\nimport type { Config, ConfigInput } from './types.ts';\n\nexport function parseConfig(input: unknown = {}): ConfigInput {\n const schema = zod.object({\n env: zod.string().optional(),\n rootPath: zod.string().optional(),\n writableDirectoryPath: zod.string().optional(),\n\n logger: zod.boolean().optional(),\n db: zod.custom<MysqlConnectionOptions | PostgresConnectionOptions | BetterSqlite3ConnectionOptions>(\n (value) => isObject(value),\n ).optional(),\n redis: zod.lazy(() => zod.union([\n zod.string().optional(),\n zod.boolean().optional(),\n zod.any().optional(),\n ])).optional(),\n smtp: zod.lazy(() => zod.union([\n zod.string().optional(),\n zod.boolean().optional(),\n zod.any().optional(),\n ])).optional(),\n port: zod.number()\n .nonnegative().optional(),\n host: zod.string().optional(),\n publicUrl: zod.string()\n .url().optional(),\n additionalDomains: zod.array(zod.string().url()).optional(),\n middlewareBody: zod.boolean()\n .or(zod.record(zod.string(), zod.any())).optional(),\n middlewareCors: zod.boolean()\n .or(zod.record(zod.string(), zod.any())).optional(),\n middlewareCookie: zod.boolean()\n .or(zod.record(zod.string(), zod.any())).optional(),\n middlewareQuery: zod.boolean()\n .or(zod.record(zod.string(), zod.any())).optional(),\n middlewarePrometheus: zod.boolean()\n .or(zod.record(zod.string(), zod.any())).optional(),\n middlewareRateLimit: zod.boolean()\n .or(zod.record(zod.string(), zod.any())).optional(),\n middlewareSwagger: zod.boolean().optional(),\n\n tokenAccessMaxAge: zod.number()\n .nonnegative().optional(),\n tokenRefreshMaxAge: zod.number()\n .nonnegative().optional(),\n registrationEnabled: zod.boolean().optional(),\n emailVerificationEnabled: zod.boolean().optional(),\n passwordRecoveryEnabled: zod.boolean().optional(),\n\n clientAuthBasic: zod.boolean().optional(),\n clientSystemEnabled: zod.boolean().optional(),\n clientSystemSecret: zod.string()\n .min(3)\n .max(256).optional(),\n clientSystemSecretReset: zod.boolean().optional(),\n\n userAuthBasic: zod.boolean().optional(),\n userAdminEnabled: zod.boolean().optional(),\n userAdminPassword: zod.string()\n .min(3)\n .max(256).optional(),\n userAdminPasswordReset: zod.boolean().optional(),\n\n robotAuthBasic: zod.boolean().optional(),\n robotAdminEnabled: zod.boolean().optional(),\n robotAdminSecret: zod.string()\n .min(3)\n .max(256).optional(),\n robotAdminSecretReset: zod.boolean().optional(),\n\n permissions: zod.string()\n .or(zod.array(zod.string()))\n .optional(),\n\n permissionsDefaultPolicyAssignment: zod.boolean().optional(),\n } satisfies Record<keyof Config, any>);\n\n return schema.parse(input);\n}\n"],"mappings":";;;;;;AAcA,SAAgBE,YAAYC,QAAiB,CAAC,GAAC;CA4E3C,OA3EeF,IAAII,OAAO;EACtBC,KAAKL,IAAIM,OAAM,CAA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AAGJ,SAAQ;EACrC0C,kBAAkBjD,IAAIW,QAAO,CAAA,CAAGJ,SAAQ;EACxC2C,mBAAmBlD,IAAIM,OAAM,CAAA,CACxBuC,IAAI,CAAA,CAAA,CACJC,IAAI,GAAA,CAAA,CAAKvC,SAAQ;EACtB4C,wBAAwBnD,IAAIW,QAAO,CAAA,CAAGJ,SAAQ;EAE9C6C,gBAAgBpD,IAAIW,QAAO,CAAA,CAAGJ,SAAQ;EACtC8C,mBAAmBrD,IAAIW,QAAO,CAAA,CAAGJ,SAAQ;EACzC+C,kBAAkBtD,IAAIM,OAAM,CAAA,CACvBuC,IAAI,CAAA,CAAA,CACJC,IAAI,GAAA,CAAA,CAAKvC,SAAQ;EACtBgD,uBAAuBvD,IAAIW,QAAO,CAAA,CAAGJ,SAAQ;EAE7CiD,aAAaxD,IAAIM,OAAM,CAAA,CAClBuB,GAAG7B,IAAI2B,MAAM3B,IAAIM,OAAM,CAAA,CAAA,CAAA,CACvBC,SAAQ;EAEbkD,oCAAoCzD,IAAIW,QAAO,CAAA,CAAGJ,SAAQ;CAC9D,CAEOJ,CAAAA,CAAOuD,MAAMxD,KAAAA;AACxB"}
1
+ {"version":3,"file":"parse.mjs","names":["isObject","ConfigValidator","parseConfig","input","Error","validator","run"],"sources":["../../../../src/app/modules/config/parse.ts"],"sourcesContent":["/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isObject } from '@authup/kit';\nimport type { ConfigInput } from './types.ts';\nimport { ConfigValidator } from './validator.ts';\n\nexport async function parseConfig(input: unknown = {}): Promise<ConfigInput> {\n if (!isObject(input)) {\n throw new Error('The configuration input must be an object.');\n }\n\n const validator = new ConfigValidator();\n\n return validator.run(input);\n}\n"],"mappings":";;;;;;AAWA,eAAsBE,YAAYC,QAAiB,CAAC,GAAC;CACjD,IAAI,CAACH,SAASG,KAAAA,GACV,MAAM,IAAIC,MAAM,4CAAA;CAKpB,OAAOC,IAFeJ,gBAEfI,CAAAA,CAAUC,IAAIH,KAAAA;AACzB"}
@@ -19,11 +19,11 @@ function readConfigRawFromEnv() {
19
19
  const host = read(ConfigEnvironmentVariableName.HOST);
20
20
  if (host) options.host = host;
21
21
  const port = readInt(ConfigEnvironmentVariableName.PORT);
22
- if (port) options.port = Number.parseInt(`${port}`, 10);
22
+ if (typeof port !== "undefined") options.port = port;
23
23
  const publicURL = read(ConfigEnvironmentVariableName.PUBLIC_URL);
24
24
  if (publicURL) options.publicUrl = publicURL;
25
- const additionalDomains = readArray(ConfigEnvironmentVariableName.ADDITIONAL_DOMAINS);
26
- if (additionalDomains && additionalDomains.length > 0) options.additionalDomains = additionalDomains;
25
+ const trustedOrigins = readArray(ConfigEnvironmentVariableName.TRUSTED_ORIGINS);
26
+ if (trustedOrigins && trustedOrigins.length > 0) options.trustedOrigins = trustedOrigins;
27
27
  const tokenAccessMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_ACCESS_MAX_AGE);
28
28
  if (typeof tokenAccessMaxAge !== "undefined") options.tokenAccessMaxAge = tokenAccessMaxAge;
29
29
  const tokenRefreshMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_MAX_AGE);
@@ -1 +1 @@
1
- {"version":3,"file":"env.mjs","names":["oneOf","read","readArray","readBool","readInt","hasEnvDataSourceOptions","readDataSourceOptionsFromEnv","ConfigEnvironmentVariableName","readConfigRawFromEnv","options","env","NODE_ENV","writableDirectoryPath","WRITABLE_DIRECTORY_PATH","db","redis","REDIS","smtp","SMTP","host","HOST","port","PORT","Number","parseInt","publicURL","PUBLIC_URL","publicUrl","additionalDomains","ADDITIONAL_DOMAINS","length","tokenAccessMaxAge","TOKEN_ACCESS_MAX_AGE","tokenRefreshMaxAge","TOKEN_REFRESH_MAX_AGE","registrationEnabled","REGISTRATION_ENABLED","emailVerificationEnabled","EMAIL_VERIFICATION_ENABLED","passwordRecoveryEnabled","PASSWORD_RECOVERY_ENABLED","clientBasicAuth","CLIENT_AUTH_BASIC","clientAuthBasic","clientSystemEnabled","CLIENT_SYSTEM_ENABLED","clientAdminSecret","CLIENT_SYSTEM_SECRET","clientSystemSecret","clientAdminSecretReset","CLIENT_SYSTEM_SECRET_RESET","clientSystemSecretReset","userBasicAuth","USER_AUTH_BASIC","userAuthBasic","userAdminEnabled","USER_ADMIN_ENABLED","userAdminPassword","USER_ADMIN_PASSWORD","userAdminPasswordReset","USER_ADMIN_PASSWORD_RESET","robotBasicAuth","ROBOT_AUTH_BASIC","robotAuthBasic","robotAdminEnabled","ROBOT_ADMIN_ENABLED","robotAdminSecret","ROBOT_ADMIN_SECRET","robotAdminSecretReset","ROBOT_ADMIN_SECRET_RESET","permissions","PERMISSIONS","permissionsDefaultPolicyAssignment","PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT"],"sources":["../../../../../src/app/modules/config/read/env.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n oneOf, \n read, \n readArray, \n readBool, \n readInt,\n} from 'envix';\nimport { hasEnvDataSourceOptions, readDataSourceOptionsFromEnv } from 'typeorm-extension';\nimport type { BetterSqlite3ConnectionOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js';\nimport type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions.js';\nimport type { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions.js';\n\nimport { ConfigEnvironmentVariableName } from '../constants.ts';\nimport type { ConfigInput } from '../types.ts';\n\nexport function readConfigRawFromEnv() : ConfigInput {\n const options : ConfigInput = {};\n\n const env = read(ConfigEnvironmentVariableName.NODE_ENV);\n if (env) {\n options.env = env;\n }\n\n const writableDirectoryPath = read(ConfigEnvironmentVariableName.WRITABLE_DIRECTORY_PATH);\n if (writableDirectoryPath) {\n options.writableDirectoryPath = writableDirectoryPath;\n }\n\n // -------------------------------------------------------------\n\n if (hasEnvDataSourceOptions()) {\n // todo: type casting should be avoided\n options.db = readDataSourceOptionsFromEnv() as MysqlConnectionOptions |\n PostgresConnectionOptions |\n BetterSqlite3ConnectionOptions;\n }\n\n const redis = oneOf([\n readBool(ConfigEnvironmentVariableName.REDIS),\n read(ConfigEnvironmentVariableName.REDIS),\n ]);\n if (typeof redis !== 'undefined') {\n options.redis = redis;\n }\n\n const smtp = oneOf([\n readBool(ConfigEnvironmentVariableName.SMTP),\n read(ConfigEnvironmentVariableName.SMTP),\n ]);\n if (typeof smtp !== 'undefined') {\n options.smtp = smtp;\n }\n\n // -------------------------------------------------------------\n\n const host = read(ConfigEnvironmentVariableName.HOST);\n if (host) {\n options.host = host;\n }\n\n const port = readInt(ConfigEnvironmentVariableName.PORT);\n if (port) {\n options.port = Number.parseInt(`${port}`, 10);\n }\n\n const publicURL = read(ConfigEnvironmentVariableName.PUBLIC_URL);\n if (publicURL) {\n options.publicUrl = publicURL;\n }\n\n const additionalDomains = readArray(ConfigEnvironmentVariableName.ADDITIONAL_DOMAINS);\n if (additionalDomains && additionalDomains.length > 0) {\n options.additionalDomains = additionalDomains;\n }\n\n const tokenAccessMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_ACCESS_MAX_AGE);\n if (typeof tokenAccessMaxAge !== 'undefined') {\n options.tokenAccessMaxAge = tokenAccessMaxAge;\n }\n\n const tokenRefreshMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_MAX_AGE);\n if (typeof tokenRefreshMaxAge !== 'undefined') {\n options.tokenRefreshMaxAge = tokenRefreshMaxAge;\n }\n\n const registrationEnabled = readBool(ConfigEnvironmentVariableName.REGISTRATION_ENABLED);\n if (typeof registrationEnabled !== 'undefined') {\n options.registrationEnabled = registrationEnabled;\n }\n\n const emailVerificationEnabled = readBool(ConfigEnvironmentVariableName.EMAIL_VERIFICATION_ENABLED);\n if (typeof emailVerificationEnabled !== 'undefined') {\n options.emailVerificationEnabled = emailVerificationEnabled;\n }\n\n const passwordRecoveryEnabled = readBool(ConfigEnvironmentVariableName.PASSWORD_RECOVERY_ENABLED);\n if (typeof passwordRecoveryEnabled !== 'undefined') {\n options.passwordRecoveryEnabled = passwordRecoveryEnabled;\n }\n\n // ---------------------------------------------------------------\n\n const clientBasicAuth = readBool(ConfigEnvironmentVariableName.CLIENT_AUTH_BASIC);\n if (typeof clientBasicAuth !== 'undefined') {\n options.clientAuthBasic = clientBasicAuth;\n }\n\n const clientSystemEnabled = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_ENABLED);\n if (typeof clientSystemEnabled !== 'undefined') {\n options.clientSystemEnabled = clientSystemEnabled;\n }\n\n const clientAdminSecret = read(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET);\n if (clientAdminSecret) {\n options.clientSystemSecret = clientAdminSecret;\n }\n\n const clientAdminSecretReset = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET_RESET);\n if (typeof clientAdminSecretReset !== 'undefined') {\n options.clientSystemSecretReset = clientAdminSecretReset;\n }\n\n // ---------------------------------------------------------------\n\n const userBasicAuth = readBool(ConfigEnvironmentVariableName.USER_AUTH_BASIC);\n if (typeof userBasicAuth !== 'undefined') {\n options.userAuthBasic = userBasicAuth;\n }\n\n const userAdminEnabled = readBool(ConfigEnvironmentVariableName.USER_ADMIN_ENABLED);\n if (typeof userAdminEnabled !== 'undefined') {\n options.userAdminEnabled = userAdminEnabled;\n }\n\n const userAdminPassword = read(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD);\n if (userAdminPassword) {\n options.userAdminPassword = userAdminPassword;\n }\n\n const userAdminPasswordReset = readBool(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD_RESET);\n if (typeof userAdminPasswordReset !== 'undefined') {\n options.userAdminPasswordReset = userAdminPasswordReset;\n }\n\n // ---------------------------------------------------------------\n\n const robotBasicAuth = readBool(ConfigEnvironmentVariableName.ROBOT_AUTH_BASIC);\n if (typeof robotBasicAuth !== 'undefined') {\n options.robotAuthBasic = robotBasicAuth;\n }\n\n const robotAdminEnabled = readBool(ConfigEnvironmentVariableName.ROBOT_ADMIN_ENABLED);\n if (typeof robotAdminEnabled !== 'undefined') {\n options.robotAdminEnabled = robotAdminEnabled;\n }\n\n const robotAdminSecret = read(ConfigEnvironmentVariableName.ROBOT_ADMIN_SECRET);\n if (robotAdminSecret) {\n options.robotAdminSecret = robotAdminSecret;\n }\n\n const robotAdminSecretReset = readBool(ConfigEnvironmentVariableName.ROBOT_ADMIN_SECRET_RESET);\n if (typeof robotAdminSecretReset !== 'undefined') {\n options.robotAdminSecretReset = robotAdminSecretReset;\n }\n\n // ---------------------------------------------------------------\n\n const permissions = readArray(ConfigEnvironmentVariableName.PERMISSIONS);\n if (permissions && permissions.length > 0) {\n options.permissions = permissions;\n }\n\n const permissionsDefaultPolicyAssignment = readBool(ConfigEnvironmentVariableName.PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT);\n if (typeof permissionsDefaultPolicyAssignment !== 'undefined') {\n options.permissionsDefaultPolicyAssignment = permissionsDefaultPolicyAssignment;\n }\n\n return options;\n}\n"],"mappings":";;;;;;;AAsBA,SAAgBQ,uBAAAA;CACZ,MAAMC,UAAwB,CAAC;CAE/B,MAAMC,MAAMT,KAAKM,8BAA8BI,QAAQ;CACvD,IAAID,KACAD,QAAQC,MAAMA;CAGlB,MAAME,wBAAwBX,KAAKM,8BAA8BM,uBAAuB;CACxF,IAAID,uBACAH,QAAQG,wBAAwBA;CAKpC,IAAIP,wBAAAA,GAEAI,QAAQK,KAAKR,6BAAAA;CAKjB,MAAMS,QAAQf,MAAM,CAChBG,SAASI,8BAA8BS,KAAK,GAC5Cf,KAAKM,8BAA8BS,KAAK,CAAA,CAC3C;CACD,IAAI,OAAOD,UAAU,aACjBN,QAAQM,QAAQA;CAGpB,MAAME,OAAOjB,MAAM,CACfG,SAASI,8BAA8BW,IAAI,GAC3CjB,KAAKM,8BAA8BW,IAAI,CA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","readBool","readInt","hasEnvDataSourceOptions","readDataSourceOptionsFromEnv","ConfigEnvironmentVariableName","readConfigRawFromEnv","options","env","NODE_ENV","writableDirectoryPath","WRITABLE_DIRECTORY_PATH","db","redis","REDIS","smtp","SMTP","host","HOST","port","PORT","publicURL","PUBLIC_URL","publicUrl","trustedOrigins","TRUSTED_ORIGINS","length","tokenAccessMaxAge","TOKEN_ACCESS_MAX_AGE","tokenRefreshMaxAge","TOKEN_REFRESH_MAX_AGE","registrationEnabled","REGISTRATION_ENABLED","emailVerificationEnabled","EMAIL_VERIFICATION_ENABLED","passwordRecoveryEnabled","PASSWORD_RECOVERY_ENABLED","clientBasicAuth","CLIENT_AUTH_BASIC","clientAuthBasic","clientSystemEnabled","CLIENT_SYSTEM_ENABLED","clientAdminSecret","CLIENT_SYSTEM_SECRET","clientSystemSecret","clientAdminSecretReset","CLIENT_SYSTEM_SECRET_RESET","clientSystemSecretReset","userBasicAuth","USER_AUTH_BASIC","userAuthBasic","userAdminEnabled","USER_ADMIN_ENABLED","userAdminPassword","USER_ADMIN_PASSWORD","userAdminPasswordReset","USER_ADMIN_PASSWORD_RESET","robotBasicAuth","ROBOT_AUTH_BASIC","robotAuthBasic","robotAdminEnabled","ROBOT_ADMIN_ENABLED","robotAdminSecret","ROBOT_ADMIN_SECRET","robotAdminSecretReset","ROBOT_ADMIN_SECRET_RESET","permissions","PERMISSIONS","permissionsDefaultPolicyAssignment","PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT"],"sources":["../../../../../src/app/modules/config/read/env.ts"],"sourcesContent":["/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n oneOf, \n read, \n readArray, \n readBool, \n readInt,\n} from 'envix';\nimport { hasEnvDataSourceOptions, readDataSourceOptionsFromEnv } from 'typeorm-extension';\nimport type { BetterSqlite3ConnectionOptions } from 'typeorm/driver/better-sqlite3/BetterSqlite3ConnectionOptions.js';\nimport type { MysqlConnectionOptions } from 'typeorm/driver/mysql/MysqlConnectionOptions.js';\nimport type { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions.js';\n\nimport { ConfigEnvironmentVariableName } from '../constants.ts';\nimport type { ConfigInput } from '../types.ts';\n\nexport function readConfigRawFromEnv() : ConfigInput {\n const options : ConfigInput = {};\n\n const env = read(ConfigEnvironmentVariableName.NODE_ENV);\n if (env) {\n options.env = env;\n }\n\n const writableDirectoryPath = read(ConfigEnvironmentVariableName.WRITABLE_DIRECTORY_PATH);\n if (writableDirectoryPath) {\n options.writableDirectoryPath = writableDirectoryPath;\n }\n\n // -------------------------------------------------------------\n\n if (hasEnvDataSourceOptions()) {\n // todo: type casting should be avoided\n options.db = readDataSourceOptionsFromEnv() as MysqlConnectionOptions |\n PostgresConnectionOptions |\n BetterSqlite3ConnectionOptions;\n }\n\n const redis = oneOf([\n readBool(ConfigEnvironmentVariableName.REDIS),\n read(ConfigEnvironmentVariableName.REDIS),\n ]);\n if (typeof redis !== 'undefined') {\n options.redis = redis;\n }\n\n const smtp = oneOf([\n readBool(ConfigEnvironmentVariableName.SMTP),\n read(ConfigEnvironmentVariableName.SMTP),\n ]);\n if (typeof smtp !== 'undefined') {\n options.smtp = smtp;\n }\n\n // -------------------------------------------------------------\n\n const host = read(ConfigEnvironmentVariableName.HOST);\n if (host) {\n options.host = host;\n }\n\n const port = readInt(ConfigEnvironmentVariableName.PORT);\n if (typeof port !== 'undefined') {\n options.port = port;\n }\n\n const publicURL = read(ConfigEnvironmentVariableName.PUBLIC_URL);\n if (publicURL) {\n options.publicUrl = publicURL;\n }\n\n const trustedOrigins = readArray(ConfigEnvironmentVariableName.TRUSTED_ORIGINS);\n if (trustedOrigins && trustedOrigins.length > 0) {\n options.trustedOrigins = trustedOrigins;\n }\n\n const tokenAccessMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_ACCESS_MAX_AGE);\n if (typeof tokenAccessMaxAge !== 'undefined') {\n options.tokenAccessMaxAge = tokenAccessMaxAge;\n }\n\n const tokenRefreshMaxAge = readInt(ConfigEnvironmentVariableName.TOKEN_REFRESH_MAX_AGE);\n if (typeof tokenRefreshMaxAge !== 'undefined') {\n options.tokenRefreshMaxAge = tokenRefreshMaxAge;\n }\n\n const registrationEnabled = readBool(ConfigEnvironmentVariableName.REGISTRATION_ENABLED);\n if (typeof registrationEnabled !== 'undefined') {\n options.registrationEnabled = registrationEnabled;\n }\n\n const emailVerificationEnabled = readBool(ConfigEnvironmentVariableName.EMAIL_VERIFICATION_ENABLED);\n if (typeof emailVerificationEnabled !== 'undefined') {\n options.emailVerificationEnabled = emailVerificationEnabled;\n }\n\n const passwordRecoveryEnabled = readBool(ConfigEnvironmentVariableName.PASSWORD_RECOVERY_ENABLED);\n if (typeof passwordRecoveryEnabled !== 'undefined') {\n options.passwordRecoveryEnabled = passwordRecoveryEnabled;\n }\n\n // ---------------------------------------------------------------\n\n const clientBasicAuth = readBool(ConfigEnvironmentVariableName.CLIENT_AUTH_BASIC);\n if (typeof clientBasicAuth !== 'undefined') {\n options.clientAuthBasic = clientBasicAuth;\n }\n\n const clientSystemEnabled = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_ENABLED);\n if (typeof clientSystemEnabled !== 'undefined') {\n options.clientSystemEnabled = clientSystemEnabled;\n }\n\n const clientAdminSecret = read(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET);\n if (clientAdminSecret) {\n options.clientSystemSecret = clientAdminSecret;\n }\n\n const clientAdminSecretReset = readBool(ConfigEnvironmentVariableName.CLIENT_SYSTEM_SECRET_RESET);\n if (typeof clientAdminSecretReset !== 'undefined') {\n options.clientSystemSecretReset = clientAdminSecretReset;\n }\n\n // ---------------------------------------------------------------\n\n const userBasicAuth = readBool(ConfigEnvironmentVariableName.USER_AUTH_BASIC);\n if (typeof userBasicAuth !== 'undefined') {\n options.userAuthBasic = userBasicAuth;\n }\n\n const userAdminEnabled = readBool(ConfigEnvironmentVariableName.USER_ADMIN_ENABLED);\n if (typeof userAdminEnabled !== 'undefined') {\n options.userAdminEnabled = userAdminEnabled;\n }\n\n const userAdminPassword = read(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD);\n if (userAdminPassword) {\n options.userAdminPassword = userAdminPassword;\n }\n\n const userAdminPasswordReset = readBool(ConfigEnvironmentVariableName.USER_ADMIN_PASSWORD_RESET);\n if (typeof userAdminPasswordReset !== 'undefined') {\n options.userAdminPasswordReset = userAdminPasswordReset;\n }\n\n // ---------------------------------------------------------------\n\n const robotBasicAuth = readBool(ConfigEnvironmentVariableName.ROBOT_AUTH_BASIC);\n if (typeof robotBasicAuth !== 'undefined') {\n options.robotAuthBasic = robotBasicAuth;\n }\n\n const robotAdminEnabled = readBool(ConfigEnvironmentVariableName.ROBOT_ADMIN_ENABLED);\n if (typeof robotAdminEnabled !== 'undefined') {\n options.robotAdminEnabled = robotAdminEnabled;\n }\n\n const robotAdminSecret = read(ConfigEnvironmentVariableName.ROBOT_ADMIN_SECRET);\n if (robotAdminSecret) {\n options.robotAdminSecret = robotAdminSecret;\n }\n\n const robotAdminSecretReset = readBool(ConfigEnvironmentVariableName.ROBOT_ADMIN_SECRET_RESET);\n if (typeof robotAdminSecretReset !== 'undefined') {\n options.robotAdminSecretReset = robotAdminSecretReset;\n }\n\n // ---------------------------------------------------------------\n\n const permissions = readArray(ConfigEnvironmentVariableName.PERMISSIONS);\n if (permissions && permissions.length > 0) {\n options.permissions = permissions;\n }\n\n const permissionsDefaultPolicyAssignment = readBool(ConfigEnvironmentVariableName.PERMISSIONS_DEFAULT_POLICY_ASSIGNMENT);\n if (typeof permissionsDefaultPolicyAssignment !== 'undefined') {\n options.permissionsDefaultPolicyAssignment = permissionsDefaultPolicyAssignment;\n }\n\n return options;\n}\n"],"mappings":";;;;;;;AAsBA,SAAgBQ,uBAAAA;CACZ,MAAMC,UAAwB,CAAC;CAE/B,MAAMC,MAAMT,KAAKM,8BAA8BI,QAAQ;CACvD,I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G/B,MAAME,wBAAwB/D,SAASI,8BAA8B4D,wBAAwB;CAC7F,IAAI,OAAOD,0BAA0B,aACjCzD,QAAQyD,wBAAwBA;CAKpC,MAAME,cAAclE,UAAUK,8BAA8B8D,WAAW;CACvE,IAAID,eAAeA,YAAYxC,SAAS,GACpCnB,QAAQ2D,cAAcA;CAG1B,MAAME,qCAAqCnE,SAASI,8BAA8BgE,qCAAqC;CACvH,IAAI,OAAOD,uCAAuC,aAC9C7D,QAAQ6D,qCAAqCA;CAGjD,OAAO7D;AACX"}
@@ -57,19 +57,26 @@ export type Config = {
57
57
  */
58
58
  publicUrl: string;
59
59
  /**
60
- * Additional origins (besides publicUrl) that are trusted as
61
- * redirect targets for the per-realm public `web` client and as
62
- * allowed CORS origins. Bare origins (scheme://host[:port]); each is
63
- * stored as `<origin>/**` in the web client's redirect_uri set.
60
+ * Trusted first-party app origins (besides publicUrl) used as
61
+ * redirect targets for the per-realm public `web` client. Does NOT
62
+ * drive CORS (the API reflects any origin by default; an explicit
63
+ * CORS allowlist goes through middlewareCors), and does not affect
64
+ * UIs using their own registered OAuth2 client. Input entries may be
65
+ * full http(s) origins (scheme://host[:port]; other protocols are
66
+ * rejected) or bare hosts (host[:port]) — a bare host expands to
67
+ * both its http and https origin during normalization, so the
68
+ * normalized config always holds full origins (scheme://host[:port],
69
+ * no path); each is stored as `<origin>/**` in the web client's
70
+ * redirect_uri set.
64
71
  *
65
72
  * SECURITY: the `web` client is built_in (auto-consent + `global`
66
73
  * scope), so any origin listed here can obtain a full-permission user
67
- * token once a user logs in. Adding a domain grants it full login
74
+ * token once a user logs in. Adding an origin grants it full login
68
75
  * capability for every realm.
69
76
  *
70
77
  * default: []
71
78
  */
72
- additionalDomains: string[];
79
+ trustedOrigins: string[];
73
80
  /**
74
81
  * use body middleware
75
82
  *
@@ -201,4 +208,5 @@ export type Config = {
201
208
  permissionsDefaultPolicyAssignment: boolean;
202
209
  };
203
210
  export type ConfigInput = Partial<Config>;
211
+ export type ConfigFactory = () => Promise<Config> | Config;
204
212
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/types.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,MAAM,MAAM,MAAM,GAAG;IACjB;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAI9B;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IAEvB;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,kBAAkB,CAAC;IAE3D;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IAI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kB,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,uBAAuB,EAAE,OAAO,CAAC;IAIjC;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAIhC;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,qBAAqB,EAAE,OAAO,CAAC;IAI/B;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE/B;;;;;;OAMG;IACH,kCAAkC,EAAE,OAAO,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE1C,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Container } from 'validup';
2
+ import type { Config } from './types.ts';
3
+ export declare class ConfigValidator extends Container<Config> {
4
+ protected initialize(): void;
5
+ }
6
+ //# sourceMappingURL=validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../../../src/app/modules/config/validator.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,qBAAa,eAAgB,SAAQ,SAAS,CAAC,MAAM,CAAC;cAC/B,UAAU;CAuFhC"}