@base44-preview/cli 0.0.41-pr.390.ad2c9f4 → 0.0.41-pr.390.c59bd67
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 +54 -39
- 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
|
|
|
@@ -239071,15 +239071,15 @@ var SSO_SECRET_KEYS = [
|
|
|
239071
239071
|
"sso_okta_domain",
|
|
239072
239072
|
"sso_jwks_uri"
|
|
239073
239073
|
];
|
|
239074
|
-
async function
|
|
239074
|
+
async function removeSSOConfig() {
|
|
239075
239075
|
const updated = await updateAuthConfig({
|
|
239076
|
-
|
|
239076
|
+
enableSSOLogin: false,
|
|
239077
239077
|
ssoProviderName: null
|
|
239078
239078
|
});
|
|
239079
239079
|
await Promise.allSettled(SSO_SECRET_KEYS.map((key) => deleteSecret(key)));
|
|
239080
239080
|
return updated;
|
|
239081
239081
|
}
|
|
239082
|
-
async function
|
|
239082
|
+
async function submitSSOConfig(secrets, authConfigUpdates) {
|
|
239083
239083
|
await setSecrets(secrets);
|
|
239084
239084
|
try {
|
|
239085
239085
|
return await updateAuthConfig(authConfigUpdates);
|
|
@@ -248258,24 +248258,29 @@ function getSiteCommand(context) {
|
|
|
248258
248258
|
}
|
|
248259
248259
|
|
|
248260
248260
|
// src/cli/commands/sso/remove.ts
|
|
248261
|
-
async function
|
|
248261
|
+
async function removeSSOAction() {
|
|
248262
248262
|
const current = await runTask("Fetching current auth config", async () => await getAuthConfig());
|
|
248263
|
-
if (!current.
|
|
248263
|
+
if (!current.enableSSOLogin) {
|
|
248264
248264
|
R2.warn("SSO is not currently enabled for this app.");
|
|
248265
248265
|
return { outroMessage: "No changes made" };
|
|
248266
248266
|
}
|
|
248267
248267
|
R2.info(`Removing SSO provider: ${theme.styles.bold(current.ssoProviderName ?? "unknown")}`);
|
|
248268
|
-
await runTask("Removing SSO configuration", async () => await
|
|
248268
|
+
await runTask("Removing SSO configuration", async () => await removeSSOConfig());
|
|
248269
248269
|
return { outroMessage: "SSO has been disabled and credentials removed" };
|
|
248270
248270
|
}
|
|
248271
|
-
function
|
|
248271
|
+
function getSSORemoveCommand(context) {
|
|
248272
248272
|
return new Command("remove").description("Remove SSO identity provider configuration").action(async () => {
|
|
248273
|
-
await runCommand(
|
|
248273
|
+
await runCommand(removeSSOAction, { requireAuth: true }, context);
|
|
248274
248274
|
});
|
|
248275
248275
|
}
|
|
248276
248276
|
|
|
248277
248277
|
// src/cli/commands/sso/providers/custom.ts
|
|
248278
248278
|
var DEFAULT_SSO_SCOPE = "openid email profile";
|
|
248279
|
+
var PLACEHOLDER_DISCOVERY_URL = "https://idp.example.com/.well-known/openid-configuration";
|
|
248280
|
+
var PLACEHOLDER_AUTH_ENDPOINT = "https://idp.example.com/authorize";
|
|
248281
|
+
var PLACEHOLDER_TOKEN_ENDPOINT = "https://idp.example.com/token";
|
|
248282
|
+
var PLACEHOLDER_USERINFO_ENDPOINT = "https://idp.example.com/userinfo";
|
|
248283
|
+
var PLACEHOLDER_JWKS_URI = "https://idp.example.com/.well-known/jwks.json";
|
|
248279
248284
|
async function promptCustomCredentials() {
|
|
248280
248285
|
const ssoName = await Ze({
|
|
248281
248286
|
message: "SSO provider name",
|
|
@@ -248325,14 +248330,14 @@ async function promptCustomCredentials() {
|
|
|
248325
248330
|
}
|
|
248326
248331
|
const discoveryUrl = await Ze({
|
|
248327
248332
|
message: "Discovery URL (optional)",
|
|
248328
|
-
placeholder:
|
|
248333
|
+
placeholder: PLACEHOLDER_DISCOVERY_URL
|
|
248329
248334
|
});
|
|
248330
248335
|
if (Ct(discoveryUrl)) {
|
|
248331
248336
|
throw new CLIExitError(0);
|
|
248332
248337
|
}
|
|
248333
248338
|
const authEndpoint = await Ze({
|
|
248334
248339
|
message: "Authorization endpoint",
|
|
248335
|
-
placeholder:
|
|
248340
|
+
placeholder: PLACEHOLDER_AUTH_ENDPOINT,
|
|
248336
248341
|
validate: (value) => {
|
|
248337
248342
|
if (!value || value.trim().length === 0) {
|
|
248338
248343
|
return "Authorization endpoint is required";
|
|
@@ -248344,7 +248349,7 @@ async function promptCustomCredentials() {
|
|
|
248344
248349
|
}
|
|
248345
248350
|
const tokenEndpoint = await Ze({
|
|
248346
248351
|
message: "Token endpoint",
|
|
248347
|
-
placeholder:
|
|
248352
|
+
placeholder: PLACEHOLDER_TOKEN_ENDPOINT,
|
|
248348
248353
|
validate: (value) => {
|
|
248349
248354
|
if (!value || value.trim().length === 0) {
|
|
248350
248355
|
return "Token endpoint is required";
|
|
@@ -248356,7 +248361,7 @@ async function promptCustomCredentials() {
|
|
|
248356
248361
|
}
|
|
248357
248362
|
const userinfoEndpoint = await Ze({
|
|
248358
248363
|
message: "Userinfo endpoint",
|
|
248359
|
-
placeholder:
|
|
248364
|
+
placeholder: PLACEHOLDER_USERINFO_ENDPOINT,
|
|
248360
248365
|
validate: (value) => {
|
|
248361
248366
|
if (!value || value.trim().length === 0) {
|
|
248362
248367
|
return "Userinfo endpoint is required";
|
|
@@ -248368,7 +248373,7 @@ async function promptCustomCredentials() {
|
|
|
248368
248373
|
}
|
|
248369
248374
|
const jwksUri = await Ze({
|
|
248370
248375
|
message: "JWKS URI",
|
|
248371
|
-
placeholder:
|
|
248376
|
+
placeholder: PLACEHOLDER_JWKS_URI,
|
|
248372
248377
|
validate: (value) => {
|
|
248373
248378
|
if (!value || value.trim().length === 0) {
|
|
248374
248379
|
return "JWKS URI is required";
|
|
@@ -248477,12 +248482,13 @@ async function promptGitHubCredentials() {
|
|
|
248477
248482
|
};
|
|
248478
248483
|
}
|
|
248479
248484
|
// src/cli/commands/sso/providers/google.ts
|
|
248480
|
-
var
|
|
248485
|
+
var DEFAULT_DISCOVERY_URL = "https://accounts.google.com/.well-known/openid-configuration";
|
|
248481
248486
|
var DEFAULT_SSO_SCOPE2 = "openid email profile";
|
|
248487
|
+
var PLACEHOLDER_CLIENT_ID = "xxxx.apps.googleusercontent.com";
|
|
248482
248488
|
async function promptGoogleCredentials() {
|
|
248483
248489
|
const clientId = await Ze({
|
|
248484
248490
|
message: "Google OAuth Client ID",
|
|
248485
|
-
placeholder:
|
|
248491
|
+
placeholder: PLACEHOLDER_CLIENT_ID,
|
|
248486
248492
|
validate: (value) => {
|
|
248487
248493
|
if (!value || value.trim().length === 0) {
|
|
248488
248494
|
return "Client ID is required";
|
|
@@ -248505,7 +248511,7 @@ async function promptGoogleCredentials() {
|
|
|
248505
248511
|
}
|
|
248506
248512
|
const discoveryUrl = await Ze({
|
|
248507
248513
|
message: "Discovery URL",
|
|
248508
|
-
initialValue:
|
|
248514
|
+
initialValue: DEFAULT_DISCOVERY_URL,
|
|
248509
248515
|
validate: (value) => {
|
|
248510
248516
|
if (!value || value.trim().length === 0) {
|
|
248511
248517
|
return "Discovery URL is required";
|
|
@@ -248537,10 +248543,15 @@ async function promptGoogleCredentials() {
|
|
|
248537
248543
|
}
|
|
248538
248544
|
// src/cli/commands/sso/providers/microsoft.ts
|
|
248539
248545
|
var DEFAULT_SSO_SCOPE3 = "openid email profile";
|
|
248546
|
+
var MICROSOFT_DISCOVERY_URL_BASE = "https://login.microsoftonline.com";
|
|
248547
|
+
var PLACEHOLDER_UUID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
|
|
248548
|
+
function buildDiscoveryUrl(tenantId) {
|
|
248549
|
+
return `${MICROSOFT_DISCOVERY_URL_BASE}/${tenantId}/v2.0/.well-known/openid-configuration`;
|
|
248550
|
+
}
|
|
248540
248551
|
async function promptMicrosoftCredentials() {
|
|
248541
248552
|
const tenantId = await Ze({
|
|
248542
248553
|
message: "Microsoft Tenant ID",
|
|
248543
|
-
placeholder:
|
|
248554
|
+
placeholder: PLACEHOLDER_UUID,
|
|
248544
248555
|
validate: (value) => {
|
|
248545
248556
|
if (!value || value.trim().length === 0) {
|
|
248546
248557
|
return "Tenant ID is required";
|
|
@@ -248552,7 +248563,7 @@ async function promptMicrosoftCredentials() {
|
|
|
248552
248563
|
}
|
|
248553
248564
|
const clientId = await Ze({
|
|
248554
248565
|
message: "Microsoft Application (Client) ID",
|
|
248555
|
-
placeholder:
|
|
248566
|
+
placeholder: PLACEHOLDER_UUID,
|
|
248556
248567
|
validate: (value) => {
|
|
248557
248568
|
if (!value || value.trim().length === 0) {
|
|
248558
248569
|
return "Client ID is required";
|
|
@@ -248575,7 +248586,7 @@ async function promptMicrosoftCredentials() {
|
|
|
248575
248586
|
}
|
|
248576
248587
|
const discoveryUrl = await Ze({
|
|
248577
248588
|
message: "Discovery URL",
|
|
248578
|
-
initialValue:
|
|
248589
|
+
initialValue: buildDiscoveryUrl(tenantId),
|
|
248579
248590
|
validate: (value) => {
|
|
248580
248591
|
if (!value || value.trim().length === 0) {
|
|
248581
248592
|
return "Discovery URL is required";
|
|
@@ -248608,10 +248619,14 @@ async function promptMicrosoftCredentials() {
|
|
|
248608
248619
|
}
|
|
248609
248620
|
// src/cli/commands/sso/providers/okta.ts
|
|
248610
248621
|
var DEFAULT_SSO_SCOPE4 = "openid email profile";
|
|
248622
|
+
var PLACEHOLDER_OKTA_DOMAIN = "your-org.okta.com";
|
|
248623
|
+
function buildDiscoveryUrl2(domain2) {
|
|
248624
|
+
return `https://${domain2}/.well-known/openid-configuration`;
|
|
248625
|
+
}
|
|
248611
248626
|
async function promptOktaCredentials() {
|
|
248612
248627
|
const oktaDomain = await Ze({
|
|
248613
248628
|
message: "Okta domain",
|
|
248614
|
-
placeholder:
|
|
248629
|
+
placeholder: PLACEHOLDER_OKTA_DOMAIN,
|
|
248615
248630
|
validate: (value) => {
|
|
248616
248631
|
if (!value || value.trim().length === 0) {
|
|
248617
248632
|
return "Okta domain is required";
|
|
@@ -248645,7 +248660,7 @@ async function promptOktaCredentials() {
|
|
|
248645
248660
|
}
|
|
248646
248661
|
const discoveryUrl = await Ze({
|
|
248647
248662
|
message: "Discovery URL",
|
|
248648
|
-
initialValue:
|
|
248663
|
+
initialValue: buildDiscoveryUrl2(oktaDomain),
|
|
248649
248664
|
validate: (value) => {
|
|
248650
248665
|
if (!value || value.trim().length === 0) {
|
|
248651
248666
|
return "Discovery URL is required";
|
|
@@ -248677,7 +248692,7 @@ async function promptOktaCredentials() {
|
|
|
248677
248692
|
};
|
|
248678
248693
|
}
|
|
248679
248694
|
// src/cli/commands/sso/setup.ts
|
|
248680
|
-
async function
|
|
248695
|
+
async function promptSSOProvider() {
|
|
248681
248696
|
const provider = await Je({
|
|
248682
248697
|
message: "Select SSO provider",
|
|
248683
248698
|
options: [
|
|
@@ -248745,36 +248760,36 @@ function buildSecretsPayload(credentials) {
|
|
|
248745
248760
|
}
|
|
248746
248761
|
function printAuthConfigSummary(config10) {
|
|
248747
248762
|
R2.info(theme.styles.bold("Updated authentication config:"));
|
|
248748
|
-
R2.info(` SSO Login: ${config10.
|
|
248763
|
+
R2.info(` SSO Login: ${config10.enableSSOLogin ? "enabled" : "disabled"}`);
|
|
248749
248764
|
R2.info(` SSO Provider: ${config10.ssoProviderName ?? "none"}`);
|
|
248750
248765
|
}
|
|
248751
|
-
async function
|
|
248766
|
+
async function setupSSOAction() {
|
|
248752
248767
|
const current = await runTask("Fetching current auth config", async () => await getAuthConfig());
|
|
248753
|
-
if (current.
|
|
248768
|
+
if (current.enableSSOLogin) {
|
|
248754
248769
|
R2.warn(`SSO is already enabled with provider: ${theme.styles.bold(current.ssoProviderName ?? "unknown")}`);
|
|
248755
248770
|
}
|
|
248756
|
-
const provider = await
|
|
248771
|
+
const provider = await promptSSOProvider();
|
|
248757
248772
|
const credentials = await credentialPrompters[provider]();
|
|
248758
248773
|
const secrets = buildSecretsPayload(credentials);
|
|
248759
|
-
const updated = await runTask("Configuring SSO", async () => await
|
|
248774
|
+
const updated = await runTask("Configuring SSO", async () => await submitSSOConfig(secrets, {
|
|
248760
248775
|
ssoProviderName: credentials.ssoName,
|
|
248761
|
-
|
|
248762
|
-
|
|
248776
|
+
enableSSOLogin: true,
|
|
248777
|
+
useWorkspaceSSO: false
|
|
248763
248778
|
}));
|
|
248764
248779
|
printAuthConfigSummary(updated);
|
|
248765
248780
|
return {
|
|
248766
248781
|
outroMessage: `SSO configured with ${provider}`
|
|
248767
248782
|
};
|
|
248768
248783
|
}
|
|
248769
|
-
function
|
|
248784
|
+
function getSSOSetupCommand(context) {
|
|
248770
248785
|
return new Command("setup").description("Configure SSO identity provider for the app").action(async () => {
|
|
248771
|
-
await runCommand(
|
|
248786
|
+
await runCommand(setupSSOAction, { requireAuth: true }, context);
|
|
248772
248787
|
});
|
|
248773
248788
|
}
|
|
248774
248789
|
|
|
248775
248790
|
// src/cli/commands/sso/index.ts
|
|
248776
|
-
function
|
|
248777
|
-
return new Command("sso").description("Manage SSO identity provider configuration").addCommand(
|
|
248791
|
+
function getSSOCommand(context) {
|
|
248792
|
+
return new Command("sso").description("Manage SSO identity provider configuration").addCommand(getSSOSetupCommand(context)).addCommand(getSSORemoveCommand(context));
|
|
248778
248793
|
}
|
|
248779
248794
|
|
|
248780
248795
|
// src/core/types/generator.ts
|
|
@@ -251584,7 +251599,7 @@ function createProgram(context) {
|
|
|
251584
251599
|
program2.addCommand(getConnectorsCommand(context));
|
|
251585
251600
|
program2.addCommand(getFunctionsDeployCommand(context));
|
|
251586
251601
|
program2.addCommand(getSecretsCommand(context));
|
|
251587
|
-
program2.addCommand(
|
|
251602
|
+
program2.addCommand(getSSOCommand(context));
|
|
251588
251603
|
program2.addCommand(getSiteCommand(context));
|
|
251589
251604
|
program2.addCommand(getTypesCommand(context));
|
|
251590
251605
|
program2.addCommand(getDevCommand(context), { hidden: true });
|
|
@@ -255829,4 +255844,4 @@ export {
|
|
|
255829
255844
|
CLIExitError
|
|
255830
255845
|
};
|
|
255831
255846
|
|
|
255832
|
-
//# debugId=
|
|
255847
|
+
//# debugId=7BD8EB5F90374BAB64756E2164756E21
|