@boxyhq/saml-jackson 0.3.5-beta.353 → 0.3.5-beta.355

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.
@@ -43,15 +43,9 @@ class Sql {
43
43
  return __awaiter(this, void 0, void 0, function* () {
44
44
  while (true) {
45
45
  try {
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
- });
46
+ // to support self signed cert like heroku postgres
47
+ const sslOpts = this.options.sslRejectUnauthorized === false ? { ssl: { rejectUnauthorized: false } } : undefined;
48
+ this.connection = yield (0, typeorm_1.createConnection)(Object.assign({ name: this.options.type + Math.floor(Math.random() * 100000), type: this.options.type, url: this.options.url, synchronize: true, migrationsTableName: '_jackson_migrations', logging: ['error'], entities: [JacksonStore_1.JacksonStore, JacksonIndex_1.JacksonIndex, JacksonTTL_1.JacksonTTL] }, sslOpts));
55
49
  break;
56
50
  }
57
51
  catch (err) {
package/dist/index.js CHANGED
@@ -44,6 +44,8 @@ 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;
47
49
  return newOpts;
48
50
  };
49
51
  const controllers = (opts) => __awaiter(void 0, void 0, void 0, function* () {
package/dist/typings.d.ts CHANGED
@@ -99,6 +99,7 @@ export interface DatabaseOption {
99
99
  ttl?: number;
100
100
  cleanupLimit?: number;
101
101
  encryptionKey?: string;
102
+ sslRejectUnauthorized?: boolean;
102
103
  }
103
104
  export interface SAMLReq {
104
105
  ssoUrl?: string;
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.5-beta.355",
4
4
  "description": "SAML 2.0 service",
5
5
  "keywords": [
6
6
  "SAML 2.0"