@boxyhq/saml-jackson 0.2.3-beta.222 → 0.2.3-beta.226
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 +7 -7
- package/src/db/mem.ts +2 -2
- package/src/db/mongo.ts +3 -3
- package/src/db/redis.ts +2 -2
- package/src/db/sql/model/JacksonStore.ts +3 -3
- package/src/db/sql/sql.ts +3 -7
- package/src/test/api.test.ts +1 -2
- package/src/typings.ts +2 -2
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@boxyhq/saml-jackson",
|
3
|
-
"version": "0.2.3-beta.
|
3
|
+
"version": "0.2.3-beta.226",
|
4
4
|
"license": "Apache 2.0",
|
5
5
|
"description": "SAML 2.0 service",
|
6
6
|
"main": "dist/index.js",
|
@@ -17,12 +17,12 @@
|
|
17
17
|
],
|
18
18
|
"scripts": {
|
19
19
|
"build": "tsc -p tsconfig.build.json",
|
20
|
-
"start": "cross-env IDP_ENABLED=true node
|
21
|
-
"dev": "cross-env IDP_ENABLED=true nodemon src/jackson.
|
22
|
-
"mongo": "cross-env JACKSON_API_KEYS=secret DB_ENGINE=mongo DB_URL=mongodb://localhost:27017/jackson
|
23
|
-
"sql": "cross-env JACKSON_API_KEYS=secret DB_ENGINE=sql DB_TYPE=postgres DB_URL=postgres://postgres:postgres@localhost:5432/jackson
|
24
|
-
"pre-loaded": "cross-env JACKSON_API_KEYS=secret DB_ENGINE=mem PRE_LOADED_CONFIG='./_config' nodemon src/jackson.
|
25
|
-
"pre-loaded-db": "cross-env JACKSON_API_KEYS=secret PRE_LOADED_CONFIG='./_config' nodemon src/jackson.
|
20
|
+
"start": "cross-env IDP_ENABLED=true node dist/jackson.js",
|
21
|
+
"dev": "cross-env IDP_ENABLED=true nodemon --config nodemon.json src/jackson.ts",
|
22
|
+
"mongo": "cross-env JACKSON_API_KEYS=secret DB_ENGINE=mongo DB_URL=mongodb://localhost:27017/jackson nodemon --config nodemon.json src/jackson.ts",
|
23
|
+
"sql": "cross-env JACKSON_API_KEYS=secret DB_ENGINE=sql DB_TYPE=postgres DB_URL=postgres://postgres:postgres@localhost:5432/jackson nodemon --config nodemon.json src/jackson.ts",
|
24
|
+
"pre-loaded": "cross-env JACKSON_API_KEYS=secret DB_ENGINE=mem PRE_LOADED_CONFIG='./_config' nodemon --config nodemon.json src/jackson.ts",
|
25
|
+
"pre-loaded-db": "cross-env JACKSON_API_KEYS=secret PRE_LOADED_CONFIG='./_config' nodemon --config nodemon.json src/jackson.ts",
|
26
26
|
"test": "tap --ts --timeout=100 src/**/*.test.ts",
|
27
27
|
"dev-dbs": "docker-compose -f ./_dev/docker-compose.yml up -d",
|
28
28
|
"dev-dbs-destroy": "docker-compose -f ./_dev/docker-compose.yml down --volumes --remove-orphans"
|
package/src/db/mem.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
// This is an in-memory implementation to be used with testing and prototyping only
|
2
2
|
|
3
|
-
import { DatabaseDriver, DatabaseOption, Index } from 'saml-jackson';
|
3
|
+
import { DatabaseDriver, DatabaseOption, Index, Encrypted } from 'saml-jackson';
|
4
4
|
import * as dbutils from './utils';
|
5
5
|
|
6
6
|
class Mem implements DatabaseDriver {
|
@@ -65,7 +65,7 @@ class Mem implements DatabaseDriver {
|
|
65
65
|
async put(
|
66
66
|
namespace: string,
|
67
67
|
key: string,
|
68
|
-
val:
|
68
|
+
val: Encrypted,
|
69
69
|
ttl: number = 0,
|
70
70
|
...indexes: any[]
|
71
71
|
): Promise<any> {
|
package/src/db/mongo.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { MongoClient } from 'mongodb';
|
2
|
-
import { DatabaseDriver, DatabaseOption, Index } from 'saml-jackson';
|
2
|
+
import { DatabaseDriver, DatabaseOption, Encrypted, Index } from 'saml-jackson';
|
3
3
|
import * as dbutils from './utils';
|
4
4
|
|
5
5
|
type Document = {
|
6
|
-
value:
|
6
|
+
value: Encrypted;
|
7
7
|
expiresAt: Date;
|
8
8
|
indexes: string[];
|
9
9
|
};
|
@@ -64,7 +64,7 @@ class Mongo implements DatabaseDriver {
|
|
64
64
|
async put(
|
65
65
|
namespace: string,
|
66
66
|
key: string,
|
67
|
-
val:
|
67
|
+
val: Encrypted,
|
68
68
|
ttl: number = 0,
|
69
69
|
...indexes: any[]
|
70
70
|
): Promise<void> {
|
package/src/db/redis.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as redis from 'redis';
|
2
|
-
import { DatabaseDriver, DatabaseOption, Index } from 'saml-jackson';
|
2
|
+
import { DatabaseDriver, DatabaseOption, Encrypted, Index } from 'saml-jackson';
|
3
3
|
import * as dbutils from './utils';
|
4
4
|
|
5
5
|
class Redis implements DatabaseDriver {
|
@@ -54,7 +54,7 @@ class Redis implements DatabaseDriver {
|
|
54
54
|
async put(
|
55
55
|
namespace: string,
|
56
56
|
key: string,
|
57
|
-
val:
|
57
|
+
val: Encrypted,
|
58
58
|
ttl: number = 0,
|
59
59
|
...indexes: any[]
|
60
60
|
): Promise<void> {
|
package/src/db/sql/sql.ts
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require('reflect-metadata');
|
4
4
|
|
5
|
-
import { DatabaseDriver, DatabaseOption, Index } from 'saml-jackson';
|
5
|
+
import { DatabaseDriver, DatabaseOption, Index, Encrypted } from 'saml-jackson';
|
6
6
|
import { Connection, createConnection } from 'typeorm';
|
7
7
|
import * as dbutils from '../utils';
|
8
8
|
import { JacksonIndex } from './model/JacksonIndex';
|
@@ -29,8 +29,6 @@ class Sql implements DatabaseDriver {
|
|
29
29
|
async init(): Promise<Sql> {
|
30
30
|
while (true) {
|
31
31
|
try {
|
32
|
-
// TODO: Fix it
|
33
|
-
// @ts-ignore
|
34
32
|
this.connection = await createConnection({
|
35
33
|
name: this.options.type + Math.floor(Math.random() * 100000),
|
36
34
|
type: this.options.type,
|
@@ -116,11 +114,10 @@ class Sql implements DatabaseDriver {
|
|
116
114
|
key: dbutils.keyForIndex(namespace, idx),
|
117
115
|
});
|
118
116
|
|
119
|
-
const ret:
|
117
|
+
const ret: Encrypted[] = [];
|
120
118
|
|
121
119
|
if (res) {
|
122
120
|
res.forEach((r) => {
|
123
|
-
// @ts-ignore
|
124
121
|
ret.push({
|
125
122
|
value: r.store.value,
|
126
123
|
iv: r.store.iv,
|
@@ -135,14 +132,13 @@ class Sql implements DatabaseDriver {
|
|
135
132
|
async put(
|
136
133
|
namespace: string,
|
137
134
|
key: string,
|
138
|
-
val:
|
135
|
+
val: Encrypted,
|
139
136
|
ttl: number = 0,
|
140
137
|
...indexes: any[]
|
141
138
|
): Promise<void> {
|
142
139
|
await this.connection.transaction(async (transactionalEntityManager) => {
|
143
140
|
const dbKey = dbutils.key(namespace, key);
|
144
141
|
|
145
|
-
// @ts-ignore
|
146
142
|
const store = new JacksonStore(dbKey, val.value, val.iv, val.tag);
|
147
143
|
|
148
144
|
await transactionalEntityManager.save(store);
|
package/src/test/api.test.ts
CHANGED