@boxyhq/saml-jackson 0.2.1-beta.154 → 0.2.1-beta.155

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boxyhq/saml-jackson",
3
- "version": "0.2.1-beta.154",
3
+ "version": "0.2.1-beta.155",
4
4
  "license": "Apache 2.0",
5
5
  "description": "SAML 2.0 service",
6
6
  "main": "src/index.js",
@@ -10,7 +10,7 @@ let configStore;
10
10
  const extractHostName = (url) => {
11
11
  try {
12
12
  const pUrl = new URL(url);
13
- if(pUrl.hostname.startsWith('www.')) {
13
+ if (pUrl.hostname.startsWith('www.')) {
14
14
  return pUrl.hostname.substring(4);
15
15
  }
16
16
  return pUrl.hostname;
@@ -56,7 +56,7 @@ const config = async (body) => {
56
56
  {
57
57
  idpMetadata,
58
58
  defaultRedirectUrl,
59
- redirectUrl: JSON.parse(redirectUrl),
59
+ redirectUrl: JSON.parse(redirectUrl), // redirectUrl is a stringified array
60
60
  tenant,
61
61
  product,
62
62
  clientID,
package/src/db/db.js CHANGED
@@ -23,7 +23,13 @@ class DB {
23
23
  throw new Error('secondary indexes not allow on a store with ttl');
24
24
  }
25
25
 
26
- return await this.db.put(namespace, key, val, ttl, ...indexes);
26
+ return await this.db.put(
27
+ namespace,
28
+ key,
29
+ JSON.stringify(val),
30
+ ttl,
31
+ ...indexes
32
+ );
27
33
  }
28
34
 
29
35
  async delete(namespace, key) {
package/src/db/mem.js CHANGED
@@ -54,7 +54,7 @@ class Mem {
54
54
  async put(namespace, key, val, ttl = 0, ...indexes) {
55
55
  const k = dbutils.key(namespace, key);
56
56
 
57
- this.store[k] = JSON.stringify(val);
57
+ this.store[k] = val;
58
58
 
59
59
  if (ttl) {
60
60
  this.ttlStore[k] = {
package/src/db/mongo.js CHANGED
@@ -48,7 +48,7 @@ class Mongo {
48
48
 
49
49
  async put(namespace, key, val, ttl = 0, ...indexes) {
50
50
  const doc = {
51
- value: JSON.stringify(val),
51
+ value: val,
52
52
  };
53
53
 
54
54
  if (ttl) {
package/src/db/redis.js CHANGED
@@ -46,7 +46,7 @@ class Redis {
46
46
  let tx = this.client.multi();
47
47
  const k = dbutils.key(namespace, key);
48
48
 
49
- tx = tx.set(k, JSON.stringify(val));
49
+ tx = tx.set(k, val);
50
50
 
51
51
  if (ttl) {
52
52
  tx = tx.expire(k, ttl);
package/src/db/sql/sql.js CHANGED
@@ -81,7 +81,7 @@ class Sql {
81
81
  key: dbutils.key(namespace, key),
82
82
  });
83
83
 
84
- if (res) {
84
+ if (res && res.value) {
85
85
  return JSON.parse(res.value);
86
86
  }
87
87
 
@@ -107,7 +107,7 @@ class Sql {
107
107
  async put(namespace, key, val, ttl = 0, ...indexes) {
108
108
  await this.connection.transaction(async (transactionalEntityManager) => {
109
109
  const dbKey = dbutils.key(namespace, key);
110
- const store = new JacksonStore(dbKey, JSON.stringify(val));
110
+ const store = new JacksonStore(dbKey, val);
111
111
  await transactionalEntityManager.save(store);
112
112
 
113
113
  if (ttl) {