@boxyhq/saml-jackson 0.3.5-beta.355 → 0.3.6
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/oauth.js +11 -3
- package/dist/db/sql/sql.js +9 -3
- package/dist/index.js +0 -2
- package/dist/typings.d.ts +0 -1
- package/package.json +1 -1
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
|
}
|
package/dist/db/sql/sql.js
CHANGED
@@ -43,9 +43,15 @@ class Sql {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
44
44
|
while (true) {
|
45
45
|
try {
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
this.connection = yield (0, typeorm_1.createConnection)({
|
47
|
+
name: this.options.type + Math.floor(Math.random() * 100000),
|
48
|
+
type: this.options.type,
|
49
|
+
url: this.options.url,
|
50
|
+
synchronize: true,
|
51
|
+
migrationsTableName: '_jackson_migrations',
|
52
|
+
logging: ['error'],
|
53
|
+
entities: [JacksonStore_1.JacksonStore, JacksonIndex_1.JacksonIndex, JacksonTTL_1.JacksonTTL],
|
54
|
+
});
|
49
55
|
break;
|
50
56
|
}
|
51
57
|
catch (err) {
|
package/dist/index.js
CHANGED
@@ -44,8 +44,6 @@ const defaultOpts = (opts) => {
|
|
44
44
|
newOpts.db.type = newOpts.db.type || 'postgres'; // Only needed if DB_ENGINE is sql.
|
45
45
|
newOpts.db.ttl = (newOpts.db.ttl || 300) * 1; // TTL for the code, session and token stores (in seconds)
|
46
46
|
newOpts.db.cleanupLimit = (newOpts.db.cleanupLimit || 1000) * 1; // Limit cleanup of TTL entries to this many items at a time
|
47
|
-
newOpts.db.sslRejectUnauthorized =
|
48
|
-
typeof newOpts.db.sslRejectUnauthorized === 'boolean' ? newOpts.db.sslRejectUnauthorized : true;
|
49
47
|
return newOpts;
|
50
48
|
};
|
51
49
|
const controllers = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
package/dist/typings.d.ts
CHANGED