@base44-preview/cli 0.0.41-pr.390.711bb5e → 0.0.41-pr.390.8eabeae
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 +46 -52
- package/dist/cli/index.js.map +13 -13
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -239000,10 +239000,10 @@ var AuthConfigSchema = exports_external.object({
|
|
|
239000
239000
|
enableFacebookLogin: data.enable_facebook_login,
|
|
239001
239001
|
enableAppleLogin: data.enable_apple_login,
|
|
239002
239002
|
ssoProviderName: data.sso_provider_name,
|
|
239003
|
-
|
|
239003
|
+
enableSSOLogin: data.enable_sso_login,
|
|
239004
239004
|
googleOAuthMode: data.google_oauth_mode,
|
|
239005
239005
|
googleOAuthClientId: data.google_oauth_client_id,
|
|
239006
|
-
|
|
239006
|
+
useWorkspaceSSO: data.use_workspace_sso
|
|
239007
239007
|
}));
|
|
239008
239008
|
var AppAuthConfigResponseSchema = exports_external.object({
|
|
239009
239009
|
auth_config: AuthConfigSchema
|
|
@@ -239018,10 +239018,10 @@ function toAuthConfigPayload(config9) {
|
|
|
239018
239018
|
enable_facebook_login: config9.enableFacebookLogin,
|
|
239019
239019
|
enable_apple_login: config9.enableAppleLogin,
|
|
239020
239020
|
sso_provider_name: config9.ssoProviderName,
|
|
239021
|
-
enable_sso_login: config9.
|
|
239021
|
+
enable_sso_login: config9.enableSSOLogin,
|
|
239022
239022
|
google_oauth_mode: config9.googleOAuthMode,
|
|
239023
239023
|
google_oauth_client_id: config9.googleOAuthClientId,
|
|
239024
|
-
use_workspace_sso: config9.
|
|
239024
|
+
use_workspace_sso: config9.useWorkspaceSSO
|
|
239025
239025
|
};
|
|
239026
239026
|
}
|
|
239027
239027
|
|
|
@@ -239058,28 +239058,29 @@ async function updateAuthConfig(updates) {
|
|
|
239058
239058
|
}
|
|
239059
239059
|
return result.data.authConfig;
|
|
239060
239060
|
}
|
|
239061
|
-
var
|
|
239062
|
-
"sso_name",
|
|
239063
|
-
"sso_client_id",
|
|
239064
|
-
"sso_client_secret",
|
|
239065
|
-
"sso_scope",
|
|
239066
|
-
"sso_discovery_url",
|
|
239067
|
-
"sso_tenant_id",
|
|
239068
|
-
"sso_auth_endpoint",
|
|
239069
|
-
"sso_token_endpoint",
|
|
239070
|
-
"sso_userinfo_endpoint",
|
|
239071
|
-
"sso_okta_domain",
|
|
239072
|
-
"sso_jwks_uri"
|
|
239073
|
-
|
|
239074
|
-
|
|
239061
|
+
var CREDENTIALS_KEY_MAP = {
|
|
239062
|
+
ssoName: "sso_name",
|
|
239063
|
+
ssoClientId: "sso_client_id",
|
|
239064
|
+
ssoClientSecret: "sso_client_secret",
|
|
239065
|
+
ssoScope: "sso_scope",
|
|
239066
|
+
ssoDiscoveryUrl: "sso_discovery_url",
|
|
239067
|
+
ssoTenantId: "sso_tenant_id",
|
|
239068
|
+
ssoAuthEndpoint: "sso_auth_endpoint",
|
|
239069
|
+
ssoTokenEndpoint: "sso_token_endpoint",
|
|
239070
|
+
ssoUserinfoEndpoint: "sso_userinfo_endpoint",
|
|
239071
|
+
ssoOktaDomain: "sso_okta_domain",
|
|
239072
|
+
ssoJwksUri: "sso_jwks_uri"
|
|
239073
|
+
};
|
|
239074
|
+
var SSO_SECRET_KEYS = Object.values(CREDENTIALS_KEY_MAP);
|
|
239075
|
+
async function removeSSOConfig() {
|
|
239075
239076
|
const updated = await updateAuthConfig({
|
|
239076
|
-
|
|
239077
|
+
enableSSOLogin: false,
|
|
239077
239078
|
ssoProviderName: null
|
|
239078
239079
|
});
|
|
239079
239080
|
await Promise.allSettled(SSO_SECRET_KEYS.map((key) => deleteSecret(key)));
|
|
239080
239081
|
return updated;
|
|
239081
239082
|
}
|
|
239082
|
-
async function
|
|
239083
|
+
async function submitSSOConfig(secrets, authConfigUpdates) {
|
|
239083
239084
|
await setSecrets(secrets);
|
|
239084
239085
|
try {
|
|
239085
239086
|
return await updateAuthConfig(authConfigUpdates);
|
|
@@ -248258,19 +248259,19 @@ function getSiteCommand(context) {
|
|
|
248258
248259
|
}
|
|
248259
248260
|
|
|
248260
248261
|
// src/cli/commands/sso/remove.ts
|
|
248261
|
-
async function
|
|
248262
|
+
async function removeSSOAction() {
|
|
248262
248263
|
const current = await runTask("Fetching current auth config", async () => await getAuthConfig());
|
|
248263
|
-
if (!current.
|
|
248264
|
+
if (!current.enableSSOLogin) {
|
|
248264
248265
|
R2.warn("SSO is not currently enabled for this app.");
|
|
248265
248266
|
return { outroMessage: "No changes made" };
|
|
248266
248267
|
}
|
|
248267
248268
|
R2.info(`Removing SSO provider: ${theme.styles.bold(current.ssoProviderName ?? "unknown")}`);
|
|
248268
|
-
await runTask("Removing SSO configuration", async () => await
|
|
248269
|
+
await runTask("Removing SSO configuration", async () => await removeSSOConfig());
|
|
248269
248270
|
return { outroMessage: "SSO has been disabled and credentials removed" };
|
|
248270
248271
|
}
|
|
248271
|
-
function
|
|
248272
|
+
function getSSORemoveCommand(context) {
|
|
248272
248273
|
return new Command("remove").description("Remove SSO identity provider configuration").action(async () => {
|
|
248273
|
-
await runCommand(
|
|
248274
|
+
await runCommand(removeSSOAction, { requireAuth: true }, context);
|
|
248274
248275
|
});
|
|
248275
248276
|
}
|
|
248276
248277
|
|
|
@@ -248692,7 +248693,7 @@ async function promptOktaCredentials() {
|
|
|
248692
248693
|
};
|
|
248693
248694
|
}
|
|
248694
248695
|
// src/cli/commands/sso/setup.ts
|
|
248695
|
-
async function
|
|
248696
|
+
async function promptSSOProvider() {
|
|
248696
248697
|
const provider = await Je({
|
|
248697
248698
|
message: "Select SSO provider",
|
|
248698
248699
|
options: [
|
|
@@ -248735,19 +248736,6 @@ var credentialPrompters = {
|
|
|
248735
248736
|
okta: promptOktaCredentials,
|
|
248736
248737
|
custom: promptCustomCredentials
|
|
248737
248738
|
};
|
|
248738
|
-
var CREDENTIALS_KEY_MAP = {
|
|
248739
|
-
ssoName: "sso_name",
|
|
248740
|
-
ssoClientId: "sso_client_id",
|
|
248741
|
-
ssoClientSecret: "sso_client_secret",
|
|
248742
|
-
ssoScope: "sso_scope",
|
|
248743
|
-
ssoDiscoveryUrl: "sso_discovery_url",
|
|
248744
|
-
ssoTenantId: "sso_tenant_id",
|
|
248745
|
-
ssoAuthEndpoint: "sso_auth_endpoint",
|
|
248746
|
-
ssoTokenEndpoint: "sso_token_endpoint",
|
|
248747
|
-
ssoUserinfoEndpoint: "sso_userinfo_endpoint",
|
|
248748
|
-
ssoOktaDomain: "sso_okta_domain",
|
|
248749
|
-
ssoJwksUri: "sso_jwks_uri"
|
|
248750
|
-
};
|
|
248751
248739
|
function buildSecretsPayload(credentials) {
|
|
248752
248740
|
const secrets = {};
|
|
248753
248741
|
for (const [camelKey, snakeKey] of Object.entries(CREDENTIALS_KEY_MAP)) {
|
|
@@ -248760,36 +248748,42 @@ function buildSecretsPayload(credentials) {
|
|
|
248760
248748
|
}
|
|
248761
248749
|
function printAuthConfigSummary(config10) {
|
|
248762
248750
|
R2.info(theme.styles.bold("Updated authentication config:"));
|
|
248763
|
-
R2.info(` SSO Login: ${config10.
|
|
248751
|
+
R2.info(` SSO Login: ${config10.enableSSOLogin ? "enabled" : "disabled"}`);
|
|
248764
248752
|
R2.info(` SSO Provider: ${config10.ssoProviderName ?? "none"}`);
|
|
248765
248753
|
}
|
|
248766
|
-
async function
|
|
248754
|
+
async function setupSSOAction() {
|
|
248767
248755
|
const current = await runTask("Fetching current auth config", async () => await getAuthConfig());
|
|
248768
|
-
if (current.
|
|
248756
|
+
if (current.enableSSOLogin) {
|
|
248769
248757
|
R2.warn(`SSO is already enabled with provider: ${theme.styles.bold(current.ssoProviderName ?? "unknown")}`);
|
|
248758
|
+
const shouldContinue = await Re({
|
|
248759
|
+
message: "Do you want to replace the existing SSO configuration?"
|
|
248760
|
+
});
|
|
248761
|
+
if (Ct(shouldContinue) || !shouldContinue) {
|
|
248762
|
+
throw new CLIExitError(0);
|
|
248763
|
+
}
|
|
248770
248764
|
}
|
|
248771
|
-
const provider = await
|
|
248765
|
+
const provider = await promptSSOProvider();
|
|
248772
248766
|
const credentials = await credentialPrompters[provider]();
|
|
248773
248767
|
const secrets = buildSecretsPayload(credentials);
|
|
248774
|
-
const updated = await runTask("Configuring SSO", async () => await
|
|
248768
|
+
const updated = await runTask("Configuring SSO", async () => await submitSSOConfig(secrets, {
|
|
248775
248769
|
ssoProviderName: credentials.ssoName,
|
|
248776
|
-
|
|
248777
|
-
|
|
248770
|
+
enableSSOLogin: true,
|
|
248771
|
+
useWorkspaceSSO: false
|
|
248778
248772
|
}));
|
|
248779
248773
|
printAuthConfigSummary(updated);
|
|
248780
248774
|
return {
|
|
248781
248775
|
outroMessage: `SSO configured with ${provider}`
|
|
248782
248776
|
};
|
|
248783
248777
|
}
|
|
248784
|
-
function
|
|
248778
|
+
function getSSOSetupCommand(context) {
|
|
248785
248779
|
return new Command("setup").description("Configure SSO identity provider for the app").action(async () => {
|
|
248786
|
-
await runCommand(
|
|
248780
|
+
await runCommand(setupSSOAction, { requireAuth: true }, context);
|
|
248787
248781
|
});
|
|
248788
248782
|
}
|
|
248789
248783
|
|
|
248790
248784
|
// src/cli/commands/sso/index.ts
|
|
248791
|
-
function
|
|
248792
|
-
return new Command("sso").description("Manage SSO identity provider configuration").addCommand(
|
|
248785
|
+
function getSSOCommand(context) {
|
|
248786
|
+
return new Command("sso").description("Manage SSO identity provider configuration").addCommand(getSSOSetupCommand(context)).addCommand(getSSORemoveCommand(context));
|
|
248793
248787
|
}
|
|
248794
248788
|
|
|
248795
248789
|
// src/core/types/generator.ts
|
|
@@ -251599,7 +251593,7 @@ function createProgram(context) {
|
|
|
251599
251593
|
program2.addCommand(getConnectorsCommand(context));
|
|
251600
251594
|
program2.addCommand(getFunctionsDeployCommand(context));
|
|
251601
251595
|
program2.addCommand(getSecretsCommand(context));
|
|
251602
|
-
program2.addCommand(
|
|
251596
|
+
program2.addCommand(getSSOCommand(context));
|
|
251603
251597
|
program2.addCommand(getSiteCommand(context));
|
|
251604
251598
|
program2.addCommand(getTypesCommand(context));
|
|
251605
251599
|
program2.addCommand(getDevCommand(context), { hidden: true });
|
|
@@ -255844,4 +255838,4 @@ export {
|
|
|
255844
255838
|
CLIExitError
|
|
255845
255839
|
};
|
|
255846
255840
|
|
|
255847
|
-
//# debugId=
|
|
255841
|
+
//# debugId=015B2FAB2C3EBEBB64756E2164756E21
|