@docupace/pipeline 1.0.18 → 1.0.19
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/package.json +1 -1
- package/src/auth0/configure.js +37 -1
package/package.json
CHANGED
package/src/auth0/configure.js
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
getVaultSecretsConfigs,
|
|
21
21
|
environmentConfig
|
|
22
22
|
} from '../next/config.js';
|
|
23
|
+
import { connect } from 'http2';
|
|
23
24
|
|
|
24
25
|
async function ensureDirectoryExists(dirPath) {
|
|
25
26
|
try {
|
|
@@ -196,8 +197,38 @@ async function templateAuth0(siteUrl, coreApiContext, env, filePaths, deployUI,
|
|
|
196
197
|
connectlAllowedLogoutUrls = [
|
|
197
198
|
`${siteUrl}/connect`
|
|
198
199
|
];
|
|
200
|
+
|
|
201
|
+
siteUrlNoPrefix=siteUrl.replace(/^https?:\/\//, '');
|
|
202
|
+
connectClientMetadata ={
|
|
203
|
+
"docupaceContext" : "core",
|
|
204
|
+
"docupaceHost" : `${siteUrlNoPrefix}`,
|
|
205
|
+
"docupace_context" : "core",
|
|
206
|
+
"docupace_host" : `${siteUrlNoPrefix} `
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
connectCallbacks = [
|
|
210
|
+
`${siteUrl}/connect/samlCallback?client_name=auth0`
|
|
211
|
+
];
|
|
212
|
+
|
|
213
|
+
connectAddons = {
|
|
214
|
+
"samlp": {
|
|
215
|
+
"audience": `${siteUrl}/connect`,
|
|
216
|
+
"recipient": `${siteUrl}/connect/samlCallback?client_name=auth0`,
|
|
217
|
+
"destination": `${siteUrl}/connect/samlCallback?client_name=auth0`,
|
|
218
|
+
"nameIdentifierFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
|
|
219
|
+
"binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",
|
|
220
|
+
"nameIdentifierProbes": [
|
|
221
|
+
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/docupace-username"
|
|
222
|
+
],
|
|
223
|
+
"mappings": {
|
|
224
|
+
"proposalHandle": "ProposalHandle"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
|
|
199
229
|
}
|
|
200
230
|
|
|
231
|
+
|
|
201
232
|
const configureUI = deployUI === 'true';
|
|
202
233
|
if (configureUI) {
|
|
203
234
|
console.log('ui_allowed_callbacks_urls ->', uiAllowedCallbacksUrls);
|
|
@@ -208,15 +239,21 @@ async function templateAuth0(siteUrl, coreApiContext, env, filePaths, deployUI,
|
|
|
208
239
|
allowed_logout_urls: uiAllowedLogoutUrls,
|
|
209
240
|
});
|
|
210
241
|
|
|
242
|
+
|
|
211
243
|
//TODO: move to separate function for connect
|
|
212
244
|
console.log('connect_allowed_callbacks_urls ->', connectAllowedCallbacksUrls);
|
|
213
245
|
console.log('connect_allowed_logout_urls ->', connectlAllowedLogoutUrls);
|
|
214
246
|
|
|
247
|
+
// update allowed callback url
|
|
215
248
|
await updateJsonFile(filePaths.connectJson, {
|
|
216
249
|
callbacks: connectAllowedCallbacksUrls,
|
|
217
250
|
allowed_logout_urls: connectlAllowedLogoutUrls,
|
|
251
|
+
client_metadata: connectClientMetadata,
|
|
252
|
+
addons: connectAddons
|
|
218
253
|
});
|
|
219
254
|
|
|
255
|
+
|
|
256
|
+
|
|
220
257
|
console.log('Updated URLs for main UI...');
|
|
221
258
|
} else {
|
|
222
259
|
await fs.promises.unlink(filePaths.uiJson);
|
|
@@ -586,7 +623,6 @@ export async function configureFromSite(fromSite, toSite, fromEnv,toEnv, deployU
|
|
|
586
623
|
|
|
587
624
|
// File paths
|
|
588
625
|
const filePaths = {
|
|
589
|
-
clientJson: './auth0-site-setup/template/clients/docupace-connect.json',
|
|
590
626
|
databaseLoginJs: './auth0-site-setup/template/database-connections/docupace/login.js',
|
|
591
627
|
loginHtml: './auth0-site-setup/template/pages/login.html',
|
|
592
628
|
graphqlJson: './auth0-site-setup/template/clients/docupace-graphql.json',
|