@boxyhq/saml-jackson 0.3.5-beta.351 → 0.3.5-beta.358
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/controller/api.d.ts
CHANGED
@@ -10,7 +10,7 @@ export declare class APIController implements IAPIController {
|
|
10
10
|
*
|
11
11
|
* /api/v1/saml/config:
|
12
12
|
* post:
|
13
|
-
*
|
13
|
+
* summary: Create SAML configuration
|
14
14
|
* operationId: create-saml-config
|
15
15
|
* tags: [SAML Config]
|
16
16
|
* produces:
|
@@ -28,21 +28,25 @@ export declare class APIController implements IAPIController {
|
|
28
28
|
* in: formData
|
29
29
|
* required: true
|
30
30
|
* type: string
|
31
|
+
* example: http://localhost:3000/login/saml
|
31
32
|
* - name: redirectUrl
|
32
33
|
* description: JSON encoded array containing a list of allowed redirect URLs
|
33
34
|
* in: formData
|
34
35
|
* required: true
|
35
36
|
* type: string
|
37
|
+
* example: '["http://localhost:3000/*"]'
|
36
38
|
* - name: tenant
|
37
39
|
* description: Tenant
|
38
40
|
* in: formData
|
39
41
|
* required: true
|
40
42
|
* type: string
|
43
|
+
* example: boxyhq.com
|
41
44
|
* - name: product
|
42
45
|
* description: Product
|
43
46
|
* in: formData
|
44
47
|
* required: true
|
45
48
|
* type: string
|
49
|
+
* example: demo
|
46
50
|
* responses:
|
47
51
|
* 200:
|
48
52
|
* description: Success
|
@@ -77,10 +81,12 @@ export declare class APIController implements IAPIController {
|
|
77
81
|
* name: tenant
|
78
82
|
* type: string
|
79
83
|
* description: Tenant
|
84
|
+
* example: boxyhq.com
|
80
85
|
* - in: query
|
81
86
|
* name: product
|
82
87
|
* type: string
|
83
88
|
* description: Product
|
89
|
+
* example: demo
|
84
90
|
* - in: query
|
85
91
|
* name: clientID
|
86
92
|
* type: string
|
@@ -128,10 +134,12 @@ export declare class APIController implements IAPIController {
|
|
128
134
|
* in: formData
|
129
135
|
* type: string
|
130
136
|
* description: Tenant
|
137
|
+
* example: boxyhq.com
|
131
138
|
* - name: product
|
132
139
|
* in: formData
|
133
140
|
* type: string
|
134
141
|
* description: Product
|
142
|
+
* example: demo
|
135
143
|
* responses:
|
136
144
|
* '200':
|
137
145
|
* description: Success
|
package/dist/controller/api.js
CHANGED
@@ -65,7 +65,7 @@ class APIController {
|
|
65
65
|
*
|
66
66
|
* /api/v1/saml/config:
|
67
67
|
* post:
|
68
|
-
*
|
68
|
+
* summary: Create SAML configuration
|
69
69
|
* operationId: create-saml-config
|
70
70
|
* tags: [SAML Config]
|
71
71
|
* produces:
|
@@ -83,21 +83,25 @@ class APIController {
|
|
83
83
|
* in: formData
|
84
84
|
* required: true
|
85
85
|
* type: string
|
86
|
+
* example: http://localhost:3000/login/saml
|
86
87
|
* - name: redirectUrl
|
87
88
|
* description: JSON encoded array containing a list of allowed redirect URLs
|
88
89
|
* in: formData
|
89
90
|
* required: true
|
90
91
|
* type: string
|
92
|
+
* example: '["http://localhost:3000/*"]'
|
91
93
|
* - name: tenant
|
92
94
|
* description: Tenant
|
93
95
|
* in: formData
|
94
96
|
* required: true
|
95
97
|
* type: string
|
98
|
+
* example: boxyhq.com
|
96
99
|
* - name: product
|
97
100
|
* description: Product
|
98
101
|
* in: formData
|
99
102
|
* required: true
|
100
103
|
* type: string
|
104
|
+
* example: demo
|
101
105
|
* responses:
|
102
106
|
* 200:
|
103
107
|
* description: Success
|
@@ -184,10 +188,12 @@ class APIController {
|
|
184
188
|
* name: tenant
|
185
189
|
* type: string
|
186
190
|
* description: Tenant
|
191
|
+
* example: boxyhq.com
|
187
192
|
* - in: query
|
188
193
|
* name: product
|
189
194
|
* type: string
|
190
195
|
* description: Product
|
196
|
+
* example: demo
|
191
197
|
* - in: query
|
192
198
|
* name: clientID
|
193
199
|
* type: string
|
@@ -250,10 +256,12 @@ class APIController {
|
|
250
256
|
* in: formData
|
251
257
|
* type: string
|
252
258
|
* description: Tenant
|
259
|
+
* example: boxyhq.com
|
253
260
|
* - name: product
|
254
261
|
* in: formData
|
255
262
|
* type: string
|
256
263
|
* description: Product
|
264
|
+
* example: demo
|
257
265
|
* responses:
|
258
266
|
* '200':
|
259
267
|
* description: Success
|
package/dist/controller/oauth.js
CHANGED
@@ -40,6 +40,9 @@ const allowed = __importStar(require("./oauth/allowed"));
|
|
40
40
|
const codeVerifier = __importStar(require("./oauth/code-verifier"));
|
41
41
|
const redirect = __importStar(require("./oauth/redirect"));
|
42
42
|
const utils_1 = require("./utils");
|
43
|
+
const util_1 = require("util");
|
44
|
+
const zlib_1 = require("zlib");
|
45
|
+
const deflateRawAsync = (0, util_1.promisify)(zlib_1.deflateRaw);
|
43
46
|
const relayStatePrefix = 'boxyhq_jackson_';
|
44
47
|
function getEncodedClientId(client_id) {
|
45
48
|
try {
|
@@ -130,9 +133,11 @@ class OAuthController {
|
|
130
133
|
code_challenge,
|
131
134
|
code_challenge_method,
|
132
135
|
});
|
136
|
+
// deepak: When supporting HTTP-POST skip deflate
|
137
|
+
const samlReqEnc = yield deflateRawAsync(samlReq.request);
|
133
138
|
const redirectUrl = redirect.success(samlConfig.idpMetadata.sso.redirectUrl, {
|
134
139
|
RelayState: relayStatePrefix + sessionId,
|
135
|
-
SAMLRequest: Buffer.from(
|
140
|
+
SAMLRequest: Buffer.from(samlReqEnc).toString('base64'),
|
136
141
|
});
|
137
142
|
return { redirect_url: redirectUrl };
|
138
143
|
});
|
@@ -333,8 +338,11 @@ class OAuthController {
|
|
333
338
|
*/
|
334
339
|
userInfo(token) {
|
335
340
|
return __awaiter(this, void 0, void 0, function* () {
|
336
|
-
const
|
337
|
-
|
341
|
+
const rsp = yield this.tokenStore.get(token);
|
342
|
+
if (!rsp || !rsp.claims) {
|
343
|
+
throw new error_1.JacksonError('Invalid token', 403);
|
344
|
+
}
|
345
|
+
return rsp.claims;
|
338
346
|
});
|
339
347
|
}
|
340
348
|
}
|