@boxyhq/saml-jackson 0.3.5-beta.353 → 0.3.6-beta.360

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.
@@ -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(samlReq.request).toString('base64'),
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 { claims } = yield this.tokenStore.get(token);
337
- return claims;
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boxyhq/saml-jackson",
3
- "version": "0.3.5-beta.353",
3
+ "version": "0.3.6-beta.360",
4
4
  "description": "SAML 2.0 service",
5
5
  "keywords": [
6
6
  "SAML 2.0"