@boxyhq/saml-jackson 0.3.0-beta.248 → 0.3.0-beta.253
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/api.d.ts +2 -14
- package/dist/controller/api.js +6 -22
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/typings.d.ts +8 -20
- package/package.json +2 -2
package/dist/controller/api.d.ts
CHANGED
@@ -1,22 +1,10 @@
|
|
1
|
-
import { IdPConfig,
|
2
|
-
export declare class
|
1
|
+
import { IdPConfig, IAPIController, OAuth } from '../typings';
|
2
|
+
export declare class APIController implements IAPIController {
|
3
3
|
private configStore;
|
4
4
|
constructor({ configStore }: {
|
5
5
|
configStore: any;
|
6
6
|
});
|
7
7
|
private _validateIdPConfig;
|
8
|
-
create(body: IdPConfig): Promise<OAuth>;
|
9
|
-
get(body: {
|
10
|
-
clientID: string;
|
11
|
-
tenant: string;
|
12
|
-
product: string;
|
13
|
-
}): Promise<Partial<OAuth>>;
|
14
|
-
delete(body: {
|
15
|
-
clientID: string;
|
16
|
-
clientSecret: string;
|
17
|
-
tenant: string;
|
18
|
-
product: string;
|
19
|
-
}): Promise<void>;
|
20
8
|
config(body: IdPConfig): Promise<OAuth>;
|
21
9
|
getConfig(body: {
|
22
10
|
clientID: string;
|
package/dist/controller/api.js
CHANGED
@@ -31,14 +31,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
31
31
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
32
32
|
};
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
34
|
-
exports.
|
34
|
+
exports.APIController = void 0;
|
35
35
|
const crypto_1 = __importDefault(require("crypto"));
|
36
36
|
const dbutils = __importStar(require("../db/utils"));
|
37
37
|
const saml_1 = __importDefault(require("../saml/saml"));
|
38
38
|
const x509_1 = __importDefault(require("../saml/x509"));
|
39
39
|
const error_1 = require("./error");
|
40
40
|
const utils_1 = require("./utils");
|
41
|
-
class
|
41
|
+
class APIController {
|
42
42
|
constructor({ configStore }) {
|
43
43
|
this.configStore = configStore;
|
44
44
|
}
|
@@ -60,7 +60,7 @@ class SAMLConfig {
|
|
60
60
|
throw new error_1.JacksonError('Please provide product', 400);
|
61
61
|
}
|
62
62
|
}
|
63
|
-
|
63
|
+
config(body) {
|
64
64
|
return __awaiter(this, void 0, void 0, function* () {
|
65
65
|
const { rawMetadata, defaultRedirectUrl, redirectUrl, tenant, product } = body;
|
66
66
|
this._validateIdPConfig(body);
|
@@ -109,7 +109,7 @@ class SAMLConfig {
|
|
109
109
|
};
|
110
110
|
});
|
111
111
|
}
|
112
|
-
|
112
|
+
getConfig(body) {
|
113
113
|
return __awaiter(this, void 0, void 0, function* () {
|
114
114
|
const { clientID, tenant, product } = body;
|
115
115
|
if (clientID) {
|
@@ -129,7 +129,7 @@ class SAMLConfig {
|
|
129
129
|
throw new error_1.JacksonError('Please provide `clientID` or `tenant` and `product`.', 400);
|
130
130
|
});
|
131
131
|
}
|
132
|
-
|
132
|
+
deleteConfig(body) {
|
133
133
|
return __awaiter(this, void 0, void 0, function* () {
|
134
134
|
const { clientID, clientSecret, tenant, product } = body;
|
135
135
|
if (clientID && clientSecret) {
|
@@ -161,24 +161,8 @@ class SAMLConfig {
|
|
161
161
|
throw new error_1.JacksonError('Please provide `clientID` and `clientSecret` or `tenant` and `product`.', 400);
|
162
162
|
});
|
163
163
|
}
|
164
|
-
// Ensure backward compatibility
|
165
|
-
config(body) {
|
166
|
-
return __awaiter(this, void 0, void 0, function* () {
|
167
|
-
return this.create(body);
|
168
|
-
});
|
169
|
-
}
|
170
|
-
getConfig(body) {
|
171
|
-
return __awaiter(this, void 0, void 0, function* () {
|
172
|
-
return this.get(body);
|
173
|
-
});
|
174
|
-
}
|
175
|
-
deleteConfig(body) {
|
176
|
-
return __awaiter(this, void 0, void 0, function* () {
|
177
|
-
return this.delete(body);
|
178
|
-
});
|
179
|
-
}
|
180
164
|
}
|
181
|
-
exports.
|
165
|
+
exports.APIController = APIController;
|
182
166
|
const extractHostName = (url) => {
|
183
167
|
try {
|
184
168
|
const pUrl = new URL(url);
|
package/dist/index.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { JacksonOption } from './typings';
|
2
|
-
import {
|
2
|
+
import { APIController } from './controller/api';
|
3
3
|
import { OAuthController } from './controller/oauth';
|
4
4
|
export declare const controllers: (opts: JacksonOption) => Promise<{
|
5
|
-
apiController:
|
5
|
+
apiController: APIController;
|
6
6
|
oauthController: OAuthController;
|
7
7
|
}>;
|
8
8
|
export default controllers;
|
package/dist/index.js
CHANGED
@@ -54,7 +54,7 @@ const controllers = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
54
|
const sessionStore = db.store('oauth:session', opts.db.ttl);
|
55
55
|
const codeStore = db.store('oauth:code', opts.db.ttl);
|
56
56
|
const tokenStore = db.store('oauth:token', opts.db.ttl);
|
57
|
-
const apiController = new api_1.
|
57
|
+
const apiController = new api_1.APIController({ configStore });
|
58
58
|
const oauthController = new oauth_1.OAuthController({
|
59
59
|
configStore,
|
60
60
|
sessionStore,
|
package/dist/typings.d.ts
CHANGED
@@ -10,7 +10,7 @@ export interface OAuth {
|
|
10
10
|
client_secret: string;
|
11
11
|
provider: string;
|
12
12
|
}
|
13
|
-
export interface
|
13
|
+
export interface IAPIController {
|
14
14
|
config(body: IdPConfig): Promise<OAuth>;
|
15
15
|
getConfig(body: {
|
16
16
|
clientID: string;
|
@@ -23,18 +23,6 @@ export interface ISAMLConfig {
|
|
23
23
|
tenant: string;
|
24
24
|
product: string;
|
25
25
|
}): Promise<void>;
|
26
|
-
create(body: IdPConfig): Promise<OAuth>;
|
27
|
-
get(body: {
|
28
|
-
clientID: string;
|
29
|
-
tenant: string;
|
30
|
-
product: string;
|
31
|
-
}): Promise<Partial<OAuth>>;
|
32
|
-
delete(body: {
|
33
|
-
clientID: string;
|
34
|
-
clientSecret: string;
|
35
|
-
tenant: string;
|
36
|
-
product: string;
|
37
|
-
}): Promise<void>;
|
38
26
|
}
|
39
27
|
export interface IOAuthController {
|
40
28
|
authorize(body: OAuthReqBody): Promise<{
|
@@ -104,12 +92,12 @@ export declare type EncryptionKey = any;
|
|
104
92
|
export declare type DatabaseEngine = 'redis' | 'sql' | 'mongo' | 'mem';
|
105
93
|
export declare type DatabaseType = 'postgres' | 'mysql' | 'mariadb';
|
106
94
|
export interface DatabaseOption {
|
107
|
-
engine
|
108
|
-
url
|
109
|
-
type
|
110
|
-
ttl
|
111
|
-
cleanupLimit
|
112
|
-
encryptionKey
|
95
|
+
engine?: DatabaseEngine;
|
96
|
+
url?: string;
|
97
|
+
type?: DatabaseType;
|
98
|
+
ttl?: number;
|
99
|
+
cleanupLimit?: number;
|
100
|
+
encryptionKey?: string;
|
113
101
|
}
|
114
102
|
export interface SAMLReq {
|
115
103
|
ssoUrl?: string;
|
@@ -130,7 +118,7 @@ export interface SAMLProfile {
|
|
130
118
|
export interface JacksonOption {
|
131
119
|
externalUrl: string;
|
132
120
|
samlPath: string;
|
133
|
-
samlAudience
|
121
|
+
samlAudience?: string;
|
134
122
|
preLoadedConfig?: string;
|
135
123
|
idpEnabled?: boolean;
|
136
124
|
db: DatabaseOption;
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@boxyhq/saml-jackson",
|
3
|
-
"version": "0.3.0-beta.
|
3
|
+
"version": "0.3.0-beta.253",
|
4
4
|
"license": "Apache 2.0",
|
5
5
|
"description": "SAML 2.0 service",
|
6
6
|
"main": "dist/index.js",
|
7
7
|
"types": "dist/index.d.ts",
|
8
8
|
"engines": {
|
9
|
-
"node": ">=14.
|
9
|
+
"node": ">=14.x"
|
10
10
|
},
|
11
11
|
"repository": {
|
12
12
|
"type": "git",
|