Skip to content

Commit

Permalink
Environment Variable & options addition for ACS Url (#3645)
Browse files Browse the repository at this point in the history
* Environment Variable & options addition for ACS Url

* Environment Variable & options addition for ACS Url

* Adding changes for adding acsUrlOverride to the Connection

* updated react-ui

* The acsUrl default value change in env.ts

---------

Co-authored-by: parth inamdar <parth@boxy.com>
Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
  • Loading branch information
3 people authored Mar 3, 2025
1 parent da0441e commit b008e64
Show file tree
Hide file tree
Showing 11 changed files with 681 additions and 404 deletions.
26 changes: 7 additions & 19 deletions lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ const hostUrl = process.env.HOST_URL || 'localhost';
const hostPort = Number(process.env.PORT || '5225');
const externalUrl = process.env.EXTERNAL_URL || 'http://' + hostUrl + ':' + hostPort;
const apiKeys = (process.env.JACKSON_API_KEYS || '').split(',');
const acsUrl = process.env.ACS_URL || externalUrl + samlPath;

let ssl;
if (process.env.DB_SSL === 'true') {
ssl = {
rejectUnauthorized: process.env.DB_SSL_REJECT_UNAUTHORIZED !== 'false',
};
ssl = { rejectUnauthorized: process.env.DB_SSL_REJECT_UNAUTHORIZED !== 'false' };
}

// Retraced
Expand Down Expand Up @@ -72,6 +71,7 @@ export const boxyhqHosted = process.env.BOXYHQ_HOSTED === '1';
const jacksonOptions: JacksonOption = {
externalUrl,
samlPath,
acsUrl,
oidcPath,
idpDiscoveryPath,
samlAudience: process.env.SAML_AUDIENCE,
Expand All @@ -89,10 +89,7 @@ const jacksonOptions: JacksonOption = {
forwardOIDCParams: process.env.OPENID_REQUEST_FORWARD_PARAMS === 'true' ? true : false,
subjectPrefix: process.env.OPENID_SUBJECT_PREFIX === 'true' ? true : false,
},
certs: {
publicKey: process.env.PUBLIC_KEY || '',
privateKey: process.env.PRIVATE_KEY || '',
},
certs: { publicKey: process.env.PUBLIC_KEY || '', privateKey: process.env.PRIVATE_KEY || '' },
boxyhqLicenseKey: process.env.BOXYHQ_LICENSE_KEY,
retraced,
noAnalytics:
Expand All @@ -101,10 +98,7 @@ const jacksonOptions: JacksonOption = {
process.env.BOXYHQ_NO_ANALYTICS === '1' ||
process.env.BOXYHQ_NO_ANALYTICS === 'true',
terminus,
webhook: {
endpoint: process.env.WEBHOOK_URL || '',
secret: process.env.WEBHOOK_SECRET || '',
},
webhook: { endpoint: process.env.WEBHOOK_URL || '', secret: process.env.WEBHOOK_SECRET || '' },
dsync: {
webhookBatchSize: process.env.DSYNC_WEBHOOK_BATCH_SIZE
? Number(process.env.DSYNC_WEBHOOK_BATCH_SIZE)
Expand All @@ -127,10 +121,7 @@ const jacksonOptions: JacksonOption = {
},
setupLinkExpiryDays,
boxyhqHosted,
ory: {
projectId: process.env.ENTERPRISE_ORY_PROJECT_ID,
sdkToken: process.env.ENTERPRISE_ORY_SDK_TOKEN,
},
ory: { projectId: process.env.ENTERPRISE_ORY_PROJECT_ID, sdkToken: process.env.ENTERPRISE_ORY_SDK_TOKEN },
ssoTraces,
};

Expand All @@ -141,10 +132,7 @@ const adminPortalSSODefaults = {
defaultRedirectUrl: `${externalUrl}/admin/auth/idp-login`,
};

const loggerOptions = {
file: process.env.LOG_FILE,
level: process.env.LOG_LEVEL,
};
const loggerOptions = { file: process.env.LOG_FILE, level: process.env.LOG_LEVEL };

export { adminPortalSSODefaults };
export { retraced as retracedOptions };
Expand Down
51 changes: 18 additions & 33 deletions npm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions npm/src/controller/connection/saml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const saml = {
description,
metadataUrl,
identifierFormat,
acsUrlOverride,
} = body;
const forceAuthn = body.forceAuthn == 'true' || body.forceAuthn == true;

Expand Down Expand Up @@ -106,6 +107,7 @@ const saml = {
identifierFormat,
metadataUrl,
sortOrder: parseInt(body.sortOrder as any),
acsUrlOverride,
};

let metadata = rawMetadata as string;
Expand Down
Loading

0 comments on commit b008e64

Please # to comment.