@base44-preview/cli 0.0.50-pr.484.ff9acc3 → 0.0.50-pr.487.fc1c45a

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.
package/dist/cli/index.js CHANGED
@@ -251262,6 +251262,19 @@ function mergeFileWithFlags(fileConfig, options) {
251262
251262
  };
251263
251263
  }
251264
251264
  var providerNames = Object.keys(KNOWN_SSO_PROVIDERS);
251265
+ function secretKeyToFlag(key) {
251266
+ return `--${key.replace(/^sso_/, "").replace(/_/g, "-")}`;
251267
+ }
251268
+ function exampleCommand(provider) {
251269
+ let cmd = `base44 auth sso enable --provider ${provider} --client-id <id> --client-secret <secret>`;
251270
+ if (provider === KNOWN_SSO_PROVIDERS.microsoft)
251271
+ cmd += " --tenant-id <id>";
251272
+ if (provider === KNOWN_SSO_PROVIDERS.okta)
251273
+ cmd += " --okta-domain <domain>";
251274
+ if (provider === KNOWN_SSO_PROVIDERS.custom)
251275
+ cmd += " --sso-name <name> --auth-endpoint <url> --token-endpoint <url> --userinfo-endpoint <url> --jwks-uri <url>";
251276
+ return cmd;
251277
+ }
251265
251278
  function validateProvider(provider) {
251266
251279
  if (!provider) {
251267
251280
  throw new InvalidInputError("Missing --provider.", {
@@ -251273,9 +251286,6 @@ function validateProvider(provider) {
251273
251286
  ]
251274
251287
  });
251275
251288
  }
251276
- if (!(provider in KNOWN_SSO_PROVIDERS)) {
251277
- throw new InvalidInputError(`Unknown provider "${provider}". Valid providers: ${providerNames.join(", ")}`);
251278
- }
251279
251289
  return provider;
251280
251290
  }
251281
251291
  async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options) {
@@ -251338,7 +251348,23 @@ async function ssoEnableAction({ isNonInteractive, runTask: runTask2 }, options)
251338
251348
  jwksUri: merged.jwksUri,
251339
251349
  ssoName: merged.ssoName
251340
251350
  };
251341
- const secrets = buildSSOSecrets(provider, secretOptions);
251351
+ let secrets;
251352
+ try {
251353
+ secrets = buildSSOSecrets(provider, secretOptions);
251354
+ } catch (error48) {
251355
+ if (error48 instanceof InvalidInputError) {
251356
+ const flagMessage = error48.message.replace(/sso_[a-z_]+/g, (key) => secretKeyToFlag(key));
251357
+ throw new InvalidInputError(flagMessage, {
251358
+ hints: [
251359
+ {
251360
+ message: `Example: ${exampleCommand(provider)}`,
251361
+ command: exampleCommand(provider)
251362
+ }
251363
+ ]
251364
+ });
251365
+ }
251366
+ throw error48;
251367
+ }
251342
251368
  const { project: project2 } = await readProjectConfig();
251343
251369
  const configDir = dirname11(project2.configPath);
251344
251370
  const authDir = join16(configDir, project2.authDir);
@@ -251370,7 +251396,7 @@ function getSSOCommand() {
251370
251396
  return new Base44Command("sso").description("Configure SSO identity provider (google, microsoft, github, okta, custom)").addArgument(new Argument("<action>", "enable or disable SSO").choices([
251371
251397
  "enable",
251372
251398
  "disable"
251373
- ])).option("--provider <provider>", "SSO provider: google, microsoft, github, okta, custom").option("--client-id <id>", "OAuth client ID").option("--client-secret <secret>", "OAuth client secret").option("--client-secret-stdin", "Read client secret from stdin").option("--env-file <path>", "Read client secret from a .env file (key: sso_client_secret)").option("--file <path>", "JSON config file with all SSO settings").option("--scope <scope>", "OAuth scope (defaults per provider)").option("--discovery-url <url>", "OIDC discovery URL").option("--tenant-id <id>", "Microsoft tenant ID (required for microsoft)").option("--okta-domain <domain>", "Okta domain (required for okta)").option("--auth-endpoint <url>", "Authorization endpoint (required for custom)").option("--token-endpoint <url>", "Token endpoint (required for custom)").option("--userinfo-endpoint <url>", "Userinfo endpoint (required for custom)").option("--jwks-uri <url>", "JWKS URI (required for custom)").option("--sso-name <name>", "Provider display name (required for custom)").action(ssoAction);
251399
+ ])).addOption(new Option("--provider <provider>", "SSO provider").choices(Object.values(KNOWN_SSO_PROVIDERS))).option("--client-id <id>", "OAuth client ID").option("--client-secret <secret>", "OAuth client secret").option("--client-secret-stdin", "Read client secret from stdin").option("--env-file <path>", "Read client secret from a .env file (key: sso_client_secret)").option("--file <path>", "JSON config file with all SSO settings").option("--scope <scope>", "OAuth scope (defaults per provider)").option("--discovery-url <url>", "OIDC discovery URL").option("--tenant-id <id>", "Microsoft tenant ID (required for microsoft)").option("--okta-domain <domain>", "Okta domain (required for okta)").option("--auth-endpoint <url>", "Authorization endpoint (required for custom)").option("--token-endpoint <url>", "Token endpoint (required for custom)").option("--userinfo-endpoint <url>", "Userinfo endpoint (required for custom)").option("--jwks-uri <url>", "JWKS URI (required for custom)").option("--sso-name <name>", "Provider display name (required for custom)").action(ssoAction);
251374
251400
  }
251375
251401
 
251376
251402
  // src/cli/commands/auth/index.ts
@@ -261005,4 +261031,4 @@ export {
261005
261031
  CLIExitError
261006
261032
  };
261007
261033
 
261008
- //# debugId=3D7486B2A6408CC364756E2164756E21
261034
+ //# debugId=CDE136D996499A7364756E2164756E21