@pega/custom-dx-components 26.1.11-alpha-0.2 → 26.1.11
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
CHANGED
|
@@ -25,8 +25,8 @@ export const getAuthQuestions = async dxcbConfig => {
|
|
|
25
25
|
answers.serverType = initAnswer('serverType', AUTHENTICATE_DEFAULTS.serverType);
|
|
26
26
|
answers.isVanity = defaultPegaConfig.isVanity;
|
|
27
27
|
answers.server = initAnswer('server', AUTHENTICATE_DEFAULTS.server);
|
|
28
|
-
answers.
|
|
29
|
-
answers.
|
|
28
|
+
answers.authorizeUri = initAnswer('authorizeUri', '');
|
|
29
|
+
answers.tokenUri = initAnswer('tokenUri', '');
|
|
30
30
|
answers.clientId = initAnswer('clientId', AUTHENTICATE_DEFAULTS.clientId);
|
|
31
31
|
answers.grantType = initAnswer('grantType', AUTHENTICATE_DEFAULTS.grantType);
|
|
32
32
|
answers.authService = initAnswer('authService', AUTHENTICATE_DEFAULTS.authService);
|
|
@@ -99,21 +99,24 @@ export const getAuthQuestions = async dxcbConfig => {
|
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
|
-
name: '
|
|
102
|
+
name: 'authorizeUri',
|
|
103
103
|
type: 'input',
|
|
104
104
|
message: 'Enter complete authorization URL',
|
|
105
|
-
default: defaultPegaConfig.
|
|
105
|
+
default: defaultPegaConfig.authorizeUri,
|
|
106
106
|
validate: value => isCompleteHttpUrl(value) || 'Authorization URL must be a complete HTTP(S) URL',
|
|
107
107
|
when: answers =>
|
|
108
|
-
answers.serverType === 'launchpad' &&
|
|
108
|
+
answers.serverType === 'launchpad' &&
|
|
109
|
+
answers.isVanity !== false &&
|
|
110
|
+
answers.grantType === 'authCode' &&
|
|
111
|
+
fnStandardWhen('authorizeUri', answers)
|
|
109
112
|
},
|
|
110
113
|
{
|
|
111
|
-
name: '
|
|
114
|
+
name: 'tokenUri',
|
|
112
115
|
type: 'input',
|
|
113
116
|
message: 'Enter complete access token URL',
|
|
114
|
-
default: defaultPegaConfig.
|
|
117
|
+
default: defaultPegaConfig.tokenUri,
|
|
115
118
|
validate: value => isCompleteHttpUrl(value) || 'Access token URL must be a complete HTTP(S) URL',
|
|
116
|
-
when: answers => answers.serverType === 'launchpad' && answers.isVanity !== false && fnStandardWhen('
|
|
119
|
+
when: answers => answers.serverType === 'launchpad' && answers.isVanity !== false && fnStandardWhen('tokenUri', answers)
|
|
117
120
|
},
|
|
118
121
|
{
|
|
119
122
|
name: 'authService',
|
|
@@ -19,15 +19,17 @@ export const generateAccessToken = async config => {
|
|
|
19
19
|
let authSuccess = false;
|
|
20
20
|
const { serverType, authService, isolationId, grantType, clientId, clientSecret, user, password, legacyTLS } = config;
|
|
21
21
|
const launchpadVanity = isLaunchpadVanity(config);
|
|
22
|
-
if (launchpadVanity && (!isCompleteHttpUrl(config.
|
|
23
|
-
throw new Error('Launchpad vanity configuration requires complete HTTP(S)
|
|
22
|
+
if (launchpadVanity && (!isCompleteHttpUrl(config.tokenUri) || (grantType === 'authCode' && !isCompleteHttpUrl(config.authorizeUri)))) {
|
|
23
|
+
throw new Error('Launchpad vanity configuration requires complete HTTP(S) authorizeUri and tokenUri values');
|
|
24
24
|
}
|
|
25
25
|
// Try to gracefully deal with missing trailing slashes for server (and later conditionally for redirectUri)
|
|
26
26
|
const server = config.server.endsWith('/') ? config.server : `${config.server}/`;
|
|
27
27
|
|
|
28
28
|
return new Promise((resolve, reject) => {
|
|
29
|
-
const
|
|
30
|
-
const
|
|
29
|
+
const sTokenUriInfinity = config.tokenUri || `${server}${INF_TOKEN_URL_V1}`;
|
|
30
|
+
const sAuthorizeUriInfinity = config.authorizeUri || `${server}${INF_AUTHORIZE_URL_V1}`;
|
|
31
|
+
const sTokenUri = launchpadVanity ? config.tokenUri : serverType === 'infinity' ? sTokenUriInfinity : `${server}${LP_TOKEN_URL}`;
|
|
32
|
+
const sAuthorizeUri = launchpadVanity ? config.authorizeUri : serverType === 'infinity' ? sAuthorizeUriInfinity : `${server}${LP_AUTHORIZE_URL}`;
|
|
31
33
|
// console.log(`grantType: ${config.grantType}`);
|
|
32
34
|
const browserAuthSuccessMarkup = `<div style="width: 300px; padding: 10px;">
|
|
33
35
|
<svg xmlns="http://www. w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 311 68" version="1.1">
|
|
@@ -164,8 +166,8 @@ export default async options => {
|
|
|
164
166
|
'serverType',
|
|
165
167
|
'server',
|
|
166
168
|
'isVanity',
|
|
167
|
-
'
|
|
168
|
-
'
|
|
169
|
+
'authorizeUri',
|
|
170
|
+
'tokenUri',
|
|
169
171
|
'isolationId',
|
|
170
172
|
'clientId',
|
|
171
173
|
'grantType',
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"@babel/preset-react": "^7.27.1",
|
|
110
110
|
"@babel/preset-typescript": "^7.27.1",
|
|
111
111
|
"@pega/configs": "^0.16.3",
|
|
112
|
-
"@pega/custom-dx-components": "~26.1.11
|
|
112
|
+
"@pega/custom-dx-components": "~26.1.11",
|
|
113
113
|
"@pega/pcore-pconnect-typedefs": "^5.1.0",
|
|
114
114
|
"@storybook/addon-docs": "^9.1.7",
|
|
115
115
|
"@storybook/addon-essentials": "^9.0.0-alpha.12",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"devServerPort": "3030",
|
|
11
11
|
"serverType": "infinity",
|
|
12
12
|
"server": "https://localhost:1080/prweb",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
13
|
+
"authorizeUri": "",
|
|
14
|
+
"authorizeUriComment": "Authorization URL for the OAuth2 authentication (mandatory when serverType is 'launchpad')",
|
|
15
|
+
"tokenUri": "",
|
|
16
|
+
"tokenUriComment": "Access token URL for the OAuth2 authentication (mandatory when serverType is 'launchpad')",
|
|
17
17
|
"clientId": "10095186356008396159",
|
|
18
18
|
"clientSecret_comment": "Needed only when using 'passwordCreds' or 'clientCreds' grantType",
|
|
19
19
|
"clientSecret": "",
|