@boxyhq/saml-jackson 1.36.0 → 1.37.1
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 +524 -475
- package/dist/controller/api.js +527 -479
- package/dist/controller/api.js.map +1 -1
- package/dist/controller/connection/oidc.d.ts +3 -2
- package/dist/controller/connection/oidc.js +26 -2
- package/dist/controller/connection/oidc.js.map +1 -1
- package/dist/controller/connection/saml.d.ts +3 -2
- package/dist/controller/connection/saml.js +26 -2
- package/dist/controller/connection/saml.js.map +1 -1
- package/dist/controller/oauth.d.ts +88 -87
- package/dist/controller/oauth.js +146 -101
- package/dist/controller/oauth.js.map +1 -1
- package/dist/controller/setup-link.d.ts +343 -234
- package/dist/controller/setup-link.js +343 -234
- package/dist/controller/setup-link.js.map +1 -1
- package/dist/db/sql/sql.js +3 -3
- package/dist/db/sql/sql.js.map +1 -1
- package/dist/directory-sync/scim/DirectoryConfig.d.ts +265 -224
- package/dist/directory-sync/scim/DirectoryConfig.js +266 -225
- package/dist/directory-sync/scim/DirectoryConfig.js.map +1 -1
- package/dist/directory-sync/scim/Groups.d.ts +82 -87
- package/dist/directory-sync/scim/Groups.js +82 -87
- package/dist/directory-sync/scim/Groups.js.map +1 -1
- package/dist/directory-sync/scim/Users.d.ts +63 -49
- package/dist/directory-sync/scim/Users.js +63 -49
- package/dist/directory-sync/scim/Users.js.map +1 -1
- package/dist/directory-sync/scim/WebhookEventsLogger.d.ts +52 -61
- package/dist/directory-sync/scim/WebhookEventsLogger.js +52 -61
- package/dist/directory-sync/scim/WebhookEventsLogger.js.map +1 -1
- package/dist/directory-sync/types.d.ts +1 -1
- package/dist/directory-sync/types.js +1 -1
- package/dist/directory-sync/types.js.map +1 -1
- package/dist/ee/identity-federation/app.d.ts +292 -212
- package/dist/ee/identity-federation/app.js +294 -214
- package/dist/ee/identity-federation/app.js.map +1 -1
- package/dist/ee/identity-federation/idp-login.js +1 -1
- package/dist/ee/identity-federation/idp-login.js.map +1 -1
- package/dist/ee/ory/ory.d.ts +18 -0
- package/dist/ee/ory/ory.js +202 -0
- package/dist/ee/ory/ory.js.map +1 -0
- package/dist/ee/product/index.d.ts +2 -2
- package/dist/ee/product/index.js +1 -1
- package/dist/ee/product/index.js.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/sso-traces/index.d.ts +67 -66
- package/dist/sso-traces/index.js +67 -66
- package/dist/sso-traces/index.js.map +1 -1
- package/dist/sso-traces/types.d.ts +1 -0
- package/dist/typings.d.ts +7 -0
- package/package.json +11 -11
@@ -0,0 +1,18 @@
|
|
1
|
+
import { JacksonOption, OryConfig, OryRes } from '../../typings';
|
2
|
+
import { ProductController } from '../product';
|
3
|
+
export declare class OryController {
|
4
|
+
private opts;
|
5
|
+
private productController;
|
6
|
+
constructor({ opts, productController }: {
|
7
|
+
opts: JacksonOption;
|
8
|
+
productController: ProductController;
|
9
|
+
});
|
10
|
+
private getOrgName;
|
11
|
+
private getIssuerUrl;
|
12
|
+
private addOrUpdateConnection;
|
13
|
+
private createOrganization;
|
14
|
+
private sanitizeConfig;
|
15
|
+
createConnection(config: OryConfig, tenant: string, product: string): Promise<OryRes | null>;
|
16
|
+
updateConnection(config: OryConfig, tenant: string, product: string): Promise<OryRes | null>;
|
17
|
+
private isEnabled;
|
18
|
+
}
|
@@ -0,0 +1,202 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
exports.OryController = void 0;
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
17
|
+
const checkLicense_1 = require("../common/checkLicense");
|
18
|
+
const basePath = 'https://api.console.ory.sh';
|
19
|
+
const providerId = 'sso_boxyhq';
|
20
|
+
const dataMapping = 'base64://bG9jYWwgY2xhaW1zID0gewogIGVtYWlsX3ZlcmlmaWVkOiB0cnVlLAp9ICsgc3RkLmV4dFZhcignY2xhaW1zJyk7Cgp7CiAgaWRlbnRpdHk6IHsKICAgIHRyYWl0czogewogICAgICBbaWYgJ2VtYWlsJyBpbiBjbGFpbXMgJiYgY2xhaW1zLmVtYWlsX3ZlcmlmaWVkIHRoZW4gJ2VtYWlsJyBlbHNlIG51bGxdOiBjbGFpbXMuZW1haWwsCiAgICB9LAogIH0sCn0=';
|
21
|
+
const issuerUrl = 'https://sso.eu.boxyhq.com';
|
22
|
+
class OryController {
|
23
|
+
constructor({ opts, productController }) {
|
24
|
+
this.opts = opts;
|
25
|
+
this.productController = productController;
|
26
|
+
}
|
27
|
+
getOrgName(tenant, product) {
|
28
|
+
return this.opts.boxyhqHosted ? tenant : `${tenant}:${product}`;
|
29
|
+
}
|
30
|
+
getIssuerUrl() {
|
31
|
+
if (this.opts.boxyhqHosted) {
|
32
|
+
return issuerUrl;
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
return this.opts.externalUrl;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
addOrUpdateConnection(config, tenant, product) {
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
40
|
+
const project = yield axios_1.default.get(`${basePath}/projects/${config.projectId}`, {
|
41
|
+
headers: {
|
42
|
+
Authorization: `Bearer ${config.sdkToken}`,
|
43
|
+
},
|
44
|
+
});
|
45
|
+
let index = '-';
|
46
|
+
try {
|
47
|
+
for (const idx in project.data.services.identity.config.selfservice.methods.oidc.config.providers) {
|
48
|
+
const provider = project.data.services.identity.config.selfservice.methods.oidc.config.providers[idx];
|
49
|
+
if (provider.id === providerId && provider.organization_id === config.organizationId) {
|
50
|
+
index = idx;
|
51
|
+
break;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
55
|
+
}
|
56
|
+
catch (err) {
|
57
|
+
// empty
|
58
|
+
}
|
59
|
+
const op = index === '-' ? 'add' : 'replace';
|
60
|
+
yield axios_1.default.patch(`${basePath}/normalized/projects/${config.projectId}/revision/${project.data.revision_id}`, [
|
61
|
+
{ op: 'replace', path: '/kratos_selfservice_methods_oidc_enabled', value: true },
|
62
|
+
{
|
63
|
+
op,
|
64
|
+
path: `/kratos_selfservice_methods_oidc_config_providers/${index}`,
|
65
|
+
value: {
|
66
|
+
provider_id: providerId,
|
67
|
+
provider: 'generic',
|
68
|
+
label: 'SSO',
|
69
|
+
client_id: `tenant=${tenant}&product=${product}`,
|
70
|
+
client_secret: this.opts.clientSecretVerifier,
|
71
|
+
organization_id: config.organizationId,
|
72
|
+
scope: [],
|
73
|
+
mapper_url: dataMapping,
|
74
|
+
additional_id_token_audiences: [],
|
75
|
+
issuer_url: this.getIssuerUrl(),
|
76
|
+
},
|
77
|
+
},
|
78
|
+
], {
|
79
|
+
headers: {
|
80
|
+
Authorization: `Bearer ${config.sdkToken}`,
|
81
|
+
},
|
82
|
+
});
|
83
|
+
});
|
84
|
+
}
|
85
|
+
createOrganization(config, label) {
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
87
|
+
var _a;
|
88
|
+
if (!config.sdkToken || !config.projectId) {
|
89
|
+
throw new Error('Ory SDK Token or Project ID not set');
|
90
|
+
}
|
91
|
+
if (config && config.organizationId) {
|
92
|
+
try {
|
93
|
+
const res = yield axios_1.default.get(`${basePath}/projects/${config.projectId}/organizations/${config.organizationId}`, {
|
94
|
+
headers: {
|
95
|
+
Authorization: `Bearer ${config.sdkToken}`,
|
96
|
+
},
|
97
|
+
});
|
98
|
+
return res.data.organization.id;
|
99
|
+
}
|
100
|
+
catch (err) {
|
101
|
+
// if org doesn't exist fall through to section that creates it below
|
102
|
+
if (((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) !== 404) {
|
103
|
+
throw err;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
const res = yield axios_1.default.post(`${basePath}/projects/${config.projectId}/organizations`, {
|
108
|
+
label,
|
109
|
+
domains: config.domains,
|
110
|
+
}, {
|
111
|
+
headers: {
|
112
|
+
Authorization: `Bearer ${config.sdkToken}`,
|
113
|
+
},
|
114
|
+
});
|
115
|
+
return res.data.id;
|
116
|
+
});
|
117
|
+
}
|
118
|
+
sanitizeConfig(config, tenant) {
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
120
|
+
var _a, _b;
|
121
|
+
if (!config.sdkToken) {
|
122
|
+
config.sdkToken = (_a = this.opts.ory) === null || _a === void 0 ? void 0 : _a.sdkToken;
|
123
|
+
}
|
124
|
+
if (!config.projectId) {
|
125
|
+
config.projectId = (_b = this.opts.ory) === null || _b === void 0 ? void 0 : _b.projectId;
|
126
|
+
}
|
127
|
+
config.domains = config.domains || [];
|
128
|
+
if (!config.domains.includes(tenant)) {
|
129
|
+
config.domains.push(tenant);
|
130
|
+
}
|
131
|
+
return config;
|
132
|
+
});
|
133
|
+
}
|
134
|
+
createConnection(config, tenant, product) {
|
135
|
+
return __awaiter(this, void 0, void 0, function* () {
|
136
|
+
if (!(yield this.isEnabled(config, tenant, product))) {
|
137
|
+
return null;
|
138
|
+
}
|
139
|
+
const organizationId = yield this.createOrganization(config, this.getOrgName(tenant, product));
|
140
|
+
config.organizationId = organizationId;
|
141
|
+
let error;
|
142
|
+
try {
|
143
|
+
yield this.addOrUpdateConnection(config, tenant, product);
|
144
|
+
}
|
145
|
+
catch (err) {
|
146
|
+
error = err;
|
147
|
+
}
|
148
|
+
return { projectId: config.projectId, domains: config.domains, organizationId, error };
|
149
|
+
});
|
150
|
+
}
|
151
|
+
updateConnection(config, tenant, product) {
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
153
|
+
if (!(yield this.isEnabled(config, tenant, product))) {
|
154
|
+
return null;
|
155
|
+
}
|
156
|
+
const organizationId = yield this.createOrganization(config, this.getOrgName(tenant, product));
|
157
|
+
let error;
|
158
|
+
try {
|
159
|
+
yield this.addOrUpdateConnection(config, tenant, product);
|
160
|
+
}
|
161
|
+
catch (err) {
|
162
|
+
error = err;
|
163
|
+
}
|
164
|
+
return { projectId: config.projectId, domains: config.domains, organizationId, error };
|
165
|
+
});
|
166
|
+
}
|
167
|
+
isEnabled(config, tenant, product) {
|
168
|
+
return __awaiter(this, void 0, void 0, function* () {
|
169
|
+
var _a, _b;
|
170
|
+
if (this.opts.boxyhqHosted) {
|
171
|
+
const productConfig = yield this.productController.get(product);
|
172
|
+
if (!productConfig ||
|
173
|
+
!productConfig.ory ||
|
174
|
+
!productConfig.ory.sdkToken ||
|
175
|
+
!productConfig.ory.projectId) {
|
176
|
+
return false;
|
177
|
+
}
|
178
|
+
config.sdkToken = productConfig.ory.sdkToken;
|
179
|
+
config.projectId = productConfig.ory.projectId;
|
180
|
+
this.sanitizeConfig(config, tenant);
|
181
|
+
return true;
|
182
|
+
}
|
183
|
+
else {
|
184
|
+
if (!((_a = this.opts.ory) === null || _a === void 0 ? void 0 : _a.sdkToken) || !((_b = this.opts.ory) === null || _b === void 0 ? void 0 : _b.projectId)) {
|
185
|
+
return false;
|
186
|
+
}
|
187
|
+
try {
|
188
|
+
yield (0, checkLicense_1.throwIfInvalidLicense)(this.opts.boxyhqLicenseKey);
|
189
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
190
|
+
}
|
191
|
+
catch (err) {
|
192
|
+
console.error('Ory is not enabled because of invalid license');
|
193
|
+
return false;
|
194
|
+
}
|
195
|
+
this.sanitizeConfig(config, tenant);
|
196
|
+
return true;
|
197
|
+
}
|
198
|
+
});
|
199
|
+
}
|
200
|
+
}
|
201
|
+
exports.OryController = OryController;
|
202
|
+
//# sourceMappingURL=ory.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ory.js","sourceRoot":"","sources":["../../../src/ee/ory/ory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,kDAA0C;AAC1C,yDAA+D;AAG/D,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAC9C,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,WAAW,GACf,2RAA2R,CAAC;AAC9R,MAAM,SAAS,GAAG,2BAA2B,CAAC;AAE9C,MAAa,aAAa;IAIxB,YAAY,EAAE,IAAI,EAAE,iBAAiB,EAAiE;QACpG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAEO,UAAU,CAAC,MAAc,EAAE,OAAe;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,OAAO,EAAE,CAAC;IAClE,CAAC;IAEO,YAAY;QAClB,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC3B,OAAO,SAAS,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;QAC/B,CAAC;IACH,CAAC;IAEa,qBAAqB,CAAC,MAAiB,EAAE,MAAc,EAAE,OAAe;;YACpF,MAAM,OAAO,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,QAAQ,aAAa,MAAM,CAAC,SAAS,EAAE,EAAE;gBAC1E,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,MAAM,CAAC,QAAQ,EAAE;iBAC3C;aACF,CAAC,CAAC;YA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,MAAM,CAAC,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAC7C,MAAM,CAAC,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC;gBAE/C,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEpC,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,GAAG,0CAAE,QAAQ,CAAA,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,GAAG,0CAAE,SAAS,CAAA,EAAE,CAAC;oBAC1D,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,IAAI,CAAC;oBACH,MAAM,IAAA,oCAAqB,EAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBACxD,6DAA6D;gBAC/D,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;oBAC/D,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;KAAA;CACF;AAlMD,sCAkMC"}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import type { Storable,
|
1
|
+
import type { Storable, ProductConfig, JacksonOptionWithRequiredLogger } from '../../typings';
|
2
2
|
export declare class ProductController {
|
3
3
|
private productStore;
|
4
4
|
private opts;
|
5
5
|
constructor({ productStore, opts }: {
|
6
6
|
productStore: Storable;
|
7
|
-
opts:
|
7
|
+
opts: JacksonOptionWithRequiredLogger;
|
8
8
|
});
|
9
9
|
get(productId: string): Promise<ProductConfig>;
|
10
10
|
upsert(params: Partial<ProductConfig> & {
|
package/dist/ee/product/index.js
CHANGED
@@ -22,7 +22,7 @@ class ProductController {
|
|
22
22
|
yield (0, checkLicense_1.throwIfInvalidLicense)(this.opts.boxyhqLicenseKey);
|
23
23
|
const productConfig = (yield this.productStore.get(productId));
|
24
24
|
// if (!productConfig) {
|
25
|
-
//
|
25
|
+
// this.opts.logger.error(`Product config not found for ${productId}`);
|
26
26
|
// }
|
27
27
|
return Object.assign(Object.assign({}, productConfig), { id: productId, name: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.name) || null, teamId: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.teamId) || null, teamName: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.teamName) || null, logoUrl: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.logoUrl) || null, faviconUrl: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.faviconUrl) || null, companyName: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.companyName) || null, primaryColor: (productConfig === null || productConfig === void 0 ? void 0 : productConfig.primaryColor) || '#25c2a0' });
|
28
28
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ee/product/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAsD;AACtD,yDAA+D;AAG/D,MAAa,iBAAiB;IAI5B,YAAY,EAAE,YAAY,EAAE,IAAI,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ee/product/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAsD;AACtD,yDAA+D;AAG/D,MAAa,iBAAiB;IAI5B,YAAY,EAAE,YAAY,EAAE,IAAI,EAAqE;QACnG,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEY,GAAG,CAAC,SAAiB;;YAChC,MAAM,IAAA,oCAAqB,EAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAExD,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CA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,CAAC;QACnD,CAAC;KAAA;IAEY,MAAM,CAAC,SAAiB;;YACnC,MAAM,IAAA,oCAAqB,EAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAExD,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC5C,CAAC;KAAA;CACF;AAlDD,8CAkDC"}
|
package/dist/index.js
CHANGED
@@ -69,6 +69,7 @@ const branding_1 = require("./ee/branding");
|
|
69
69
|
const sso_traces_1 = __importDefault(require("./sso-traces"));
|
70
70
|
const event_1 = __importDefault(require("./event"));
|
71
71
|
const product_1 = require("./ee/product");
|
72
|
+
const ory_1 = require("./ee/ory/ory");
|
72
73
|
const TRACES_TTL_DEFAULT = 7 * 24 * 60 * 60;
|
73
74
|
const defaultOpts = (opts) => {
|
74
75
|
var _a, _b, _c, _d, _e;
|
@@ -119,11 +120,16 @@ const controllers = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
119
120
|
const tracesStore = db.store('saml:tracer', (_a = opts.ssoTraces) === null || _a === void 0 ? void 0 : _a.ttl);
|
120
121
|
const ssoTraces = new sso_traces_1.default({ tracesStore, opts });
|
121
122
|
const eventController = new event_1.default({ opts: opts });
|
122
|
-
const productController = new product_1.ProductController({
|
123
|
+
const productController = new product_1.ProductController({
|
124
|
+
productStore,
|
125
|
+
opts: opts,
|
126
|
+
});
|
127
|
+
const oryController = new ory_1.OryController({ opts, productController });
|
123
128
|
const connectionAPIController = new api_1.ConnectionAPIController({
|
124
129
|
connectionStore,
|
125
130
|
opts,
|
126
131
|
eventController,
|
132
|
+
oryController,
|
127
133
|
});
|
128
134
|
const adminController = new admin_1.AdminController({ connectionStore, ssoTraces });
|
129
135
|
const healthCheckController = new health_check_1.HealthCheckController({ healthCheckStore });
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;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mBAAmB,GAAG,IAAI,+BAAmB,CAAC;YAClD,IAAI;YACJ,cAAc;YACd,uBAAuB;YACvB,uBAAuB;SACxB,CAAC,CAAC;QACH,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,QAAQ,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC;QACxB,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,MAAM,KAAK,KAAK,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACtF,MAAM,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,EAAE,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,OAAO;QACL,QAAQ;QACR,aAAa,EAAE,uBAAuB;QACtC,uBAAuB;QACvB,eAAe;QACf,eAAe;QACf,gBAAgB;QAChB,qBAAqB;QACrB,mBAAmB;QACnB,uBAAuB;QACvB,uBAAuB;QACvB,4BAA4B;QAC5B,kBAAkB;QAClB,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO,IAAA,sBAAY,EAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC7C,CAAC;QACD,iBAAiB;QACjB,KAAK,EAAE,GAAS,EAAE;YAChB,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC,CAAA;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAnJW,QAAA,WAAW,eAmJtB;AAEF,kBAAe,mBAAW,CAAC;AAE3B,4CAA0B;AAC1B,iEAA+C"}
|
@@ -1,51 +1,5 @@
|
|
1
1
|
import { GetByProductParams, Records, Storable, JacksonOptionWithRequiredLogger } from '../typings';
|
2
2
|
import type { SSOTrace, Trace } from './types';
|
3
|
-
/**
|
4
|
-
* @swagger
|
5
|
-
* definitions:
|
6
|
-
* SSOTrace:
|
7
|
-
* type: object
|
8
|
-
* properties:
|
9
|
-
* traceId:
|
10
|
-
* type: string
|
11
|
-
* description: Trace ID
|
12
|
-
* error:
|
13
|
-
* type: string
|
14
|
-
* description: Error
|
15
|
-
* timestamp:
|
16
|
-
* type: string
|
17
|
-
* description: Timestamp
|
18
|
-
* context:
|
19
|
-
* type: object
|
20
|
-
* properties:
|
21
|
-
* tenant:
|
22
|
-
* type: string
|
23
|
-
* description: Tenant
|
24
|
-
* product:
|
25
|
-
* type: string
|
26
|
-
* description: Product
|
27
|
-
* clientID:
|
28
|
-
* type: string
|
29
|
-
* description: Connection client ID
|
30
|
-
* issuer:
|
31
|
-
* type: string
|
32
|
-
* description: Issuer
|
33
|
-
* relayState:
|
34
|
-
* type: string
|
35
|
-
* description: Relay state
|
36
|
-
* samlResponse:
|
37
|
-
* type: string
|
38
|
-
* description: SAML response
|
39
|
-
* isSAMLFederated:
|
40
|
-
* type: boolean
|
41
|
-
* description: Indicates if SAML is federated
|
42
|
-
* isOIDCFederated:
|
43
|
-
* type: boolean
|
44
|
-
* description: Indicates if OIDC is federated
|
45
|
-
* isIdPFlow:
|
46
|
-
* type: boolean
|
47
|
-
* description: Indicates if request is from IdP
|
48
|
-
*/
|
49
3
|
declare class SSOTraces {
|
50
4
|
tracesStore: Storable;
|
51
5
|
opts: JacksonOptionWithRequiredLogger;
|
@@ -55,44 +9,91 @@ declare class SSOTraces {
|
|
55
9
|
});
|
56
10
|
saveTrace(payload: SSOTrace): Promise<string | undefined>;
|
57
11
|
/**
|
58
|
-
* @
|
12
|
+
* @openapi
|
13
|
+
* components:
|
14
|
+
* schemas:
|
15
|
+
* SSOTrace:
|
16
|
+
* type: object
|
17
|
+
* properties:
|
18
|
+
* traceId:
|
19
|
+
* type: string
|
20
|
+
* description: Trace ID
|
21
|
+
* error:
|
22
|
+
* type: string
|
23
|
+
* description: Error
|
24
|
+
* timestamp:
|
25
|
+
* type: string
|
26
|
+
* description: Timestamp
|
27
|
+
* context:
|
28
|
+
* type: object
|
29
|
+
* properties:
|
30
|
+
* tenant:
|
31
|
+
* type: string
|
32
|
+
* description: Tenant
|
33
|
+
* product:
|
34
|
+
* type: string
|
35
|
+
* description: Product
|
36
|
+
* clientID:
|
37
|
+
* type: string
|
38
|
+
* description: Connection client ID
|
39
|
+
* issuer:
|
40
|
+
* type: string
|
41
|
+
* description: Issuer
|
42
|
+
* relayState:
|
43
|
+
* type: string
|
44
|
+
* description: Relay state
|
45
|
+
* samlResponse:
|
46
|
+
* type: string
|
47
|
+
* description: SAML response
|
48
|
+
* isSAMLFederated:
|
49
|
+
* type: boolean
|
50
|
+
* description: Indicates if SAML is federated
|
51
|
+
* isOIDCFederated:
|
52
|
+
* type: boolean
|
53
|
+
* description: Indicates if OIDC is federated
|
54
|
+
* isIdPFlow:
|
55
|
+
* type: boolean
|
56
|
+
* description: Indicates if request is from IdP
|
57
|
+
*
|
58
|
+
*/
|
59
|
+
/**
|
60
|
+
* @openapi
|
59
61
|
* /api/v1/sso-traces:
|
60
62
|
* get:
|
63
|
+
* tags:
|
64
|
+
* - SSO Traces
|
61
65
|
* summary: Get trace by ID
|
62
66
|
* parameters:
|
63
67
|
* - name: id
|
64
|
-
* description: Trace ID
|
65
68
|
* in: query
|
69
|
+
* description: Trace ID
|
66
70
|
* required: true
|
67
|
-
*
|
68
|
-
*
|
69
|
-
* - SSO Traces
|
70
|
-
* produces:
|
71
|
-
* - application/json
|
71
|
+
* schema:
|
72
|
+
* type: string
|
72
73
|
* responses:
|
73
|
-
*
|
74
|
+
* 200:
|
74
75
|
* description: Success
|
75
|
-
*
|
76
|
-
*
|
76
|
+
* content:
|
77
|
+
* application/json:
|
78
|
+
* schema:
|
79
|
+
* $ref: "#/components/schemas/SSOTrace"
|
77
80
|
*/
|
78
81
|
getByTraceId(traceId: string): Promise<Trace>;
|
79
82
|
getAllTraces(pageOffset?: number, pageLimit?: number, pageToken?: string): Promise<Records<Trace>>;
|
80
83
|
/** Cleans up stale traces older than 1 week */
|
81
84
|
cleanUpStaleTraces(): Promise<void>;
|
82
85
|
/**
|
83
|
-
* @
|
86
|
+
* @openapi
|
84
87
|
* /api/v1/sso-traces/product:
|
85
88
|
* get:
|
86
|
-
* summary: Get all traces for a product
|
87
|
-
* parameters:
|
88
|
-
* - $ref: '#/parameters/product'
|
89
|
-
* - $ref: '#/parameters/pageOffset'
|
90
|
-
* - $ref: '#/parameters/pageLimit'
|
91
|
-
* - $ref: '#/parameters/pageToken'
|
92
89
|
* tags:
|
93
90
|
* - SSO Traces
|
94
|
-
*
|
95
|
-
*
|
91
|
+
* summary: Get all traces for a product
|
92
|
+
* parameters:
|
93
|
+
* - $ref: '#/components/parameters/product'
|
94
|
+
* - $ref: '#/components/parameters/pageOffset'
|
95
|
+
* - $ref: '#/components/parameters/pageLimit'
|
96
|
+
* - $ref: '#/components/parameters/pageToken'
|
96
97
|
* responses:
|
97
98
|
* '200':
|
98
99
|
* description: Success
|
@@ -104,7 +105,7 @@ declare class SSOTraces {
|
|
104
105
|
* data:
|
105
106
|
* type: array
|
106
107
|
* items:
|
107
|
-
* $ref: '#/
|
108
|
+
* $ref: '#/components/schemas/SSOTrace'
|
108
109
|
* pageToken:
|
109
110
|
* type: string
|
110
111
|
* description: token for pagination
|
package/dist/sso-traces/index.js
CHANGED
@@ -16,52 +16,6 @@ const error_1 = require("../controller/error");
|
|
16
16
|
const INTERVAL_1_WEEK_MS = 7 * 24 * 60 * 60 * 1000;
|
17
17
|
const INTERVAL_1_DAY_MS = 24 * 60 * 60 * 1000;
|
18
18
|
const SSO_TRACES_REDACT_KEYS = ['profile', 'oidcTokenSet', 'samlResponse'];
|
19
|
-
/**
|
20
|
-
* @swagger
|
21
|
-
* definitions:
|
22
|
-
* SSOTrace:
|
23
|
-
* type: object
|
24
|
-
* properties:
|
25
|
-
* traceId:
|
26
|
-
* type: string
|
27
|
-
* description: Trace ID
|
28
|
-
* error:
|
29
|
-
* type: string
|
30
|
-
* description: Error
|
31
|
-
* timestamp:
|
32
|
-
* type: string
|
33
|
-
* description: Timestamp
|
34
|
-
* context:
|
35
|
-
* type: object
|
36
|
-
* properties:
|
37
|
-
* tenant:
|
38
|
-
* type: string
|
39
|
-
* description: Tenant
|
40
|
-
* product:
|
41
|
-
* type: string
|
42
|
-
* description: Product
|
43
|
-
* clientID:
|
44
|
-
* type: string
|
45
|
-
* description: Connection client ID
|
46
|
-
* issuer:
|
47
|
-
* type: string
|
48
|
-
* description: Issuer
|
49
|
-
* relayState:
|
50
|
-
* type: string
|
51
|
-
* description: Relay state
|
52
|
-
* samlResponse:
|
53
|
-
* type: string
|
54
|
-
* description: SAML response
|
55
|
-
* isSAMLFederated:
|
56
|
-
* type: boolean
|
57
|
-
* description: Indicates if SAML is federated
|
58
|
-
* isOIDCFederated:
|
59
|
-
* type: boolean
|
60
|
-
* description: Indicates if OIDC is federated
|
61
|
-
* isIdPFlow:
|
62
|
-
* type: boolean
|
63
|
-
* description: Indicates if request is from IdP
|
64
|
-
*/
|
65
19
|
class SSOTraces {
|
66
20
|
constructor({ tracesStore, opts }) {
|
67
21
|
this.tracesStore = tracesStore;
|
@@ -118,25 +72,74 @@ class SSOTraces {
|
|
118
72
|
});
|
119
73
|
}
|
120
74
|
/**
|
121
|
-
* @
|
75
|
+
* @openapi
|
76
|
+
* components:
|
77
|
+
* schemas:
|
78
|
+
* SSOTrace:
|
79
|
+
* type: object
|
80
|
+
* properties:
|
81
|
+
* traceId:
|
82
|
+
* type: string
|
83
|
+
* description: Trace ID
|
84
|
+
* error:
|
85
|
+
* type: string
|
86
|
+
* description: Error
|
87
|
+
* timestamp:
|
88
|
+
* type: string
|
89
|
+
* description: Timestamp
|
90
|
+
* context:
|
91
|
+
* type: object
|
92
|
+
* properties:
|
93
|
+
* tenant:
|
94
|
+
* type: string
|
95
|
+
* description: Tenant
|
96
|
+
* product:
|
97
|
+
* type: string
|
98
|
+
* description: Product
|
99
|
+
* clientID:
|
100
|
+
* type: string
|
101
|
+
* description: Connection client ID
|
102
|
+
* issuer:
|
103
|
+
* type: string
|
104
|
+
* description: Issuer
|
105
|
+
* relayState:
|
106
|
+
* type: string
|
107
|
+
* description: Relay state
|
108
|
+
* samlResponse:
|
109
|
+
* type: string
|
110
|
+
* description: SAML response
|
111
|
+
* isSAMLFederated:
|
112
|
+
* type: boolean
|
113
|
+
* description: Indicates if SAML is federated
|
114
|
+
* isOIDCFederated:
|
115
|
+
* type: boolean
|
116
|
+
* description: Indicates if OIDC is federated
|
117
|
+
* isIdPFlow:
|
118
|
+
* type: boolean
|
119
|
+
* description: Indicates if request is from IdP
|
120
|
+
*
|
121
|
+
*/
|
122
|
+
/**
|
123
|
+
* @openapi
|
122
124
|
* /api/v1/sso-traces:
|
123
125
|
* get:
|
126
|
+
* tags:
|
127
|
+
* - SSO Traces
|
124
128
|
* summary: Get trace by ID
|
125
129
|
* parameters:
|
126
130
|
* - name: id
|
127
|
-
* description: Trace ID
|
128
131
|
* in: query
|
132
|
+
* description: Trace ID
|
129
133
|
* required: true
|
130
|
-
*
|
131
|
-
*
|
132
|
-
* - SSO Traces
|
133
|
-
* produces:
|
134
|
-
* - application/json
|
134
|
+
* schema:
|
135
|
+
* type: string
|
135
136
|
* responses:
|
136
|
-
*
|
137
|
+
* 200:
|
137
138
|
* description: Success
|
138
|
-
*
|
139
|
-
*
|
139
|
+
* content:
|
140
|
+
* application/json:
|
141
|
+
* schema:
|
142
|
+
* $ref: "#/components/schemas/SSOTrace"
|
140
143
|
*/
|
141
144
|
getByTraceId(traceId) {
|
142
145
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -166,19 +169,17 @@ class SSOTraces {
|
|
166
169
|
});
|
167
170
|
}
|
168
171
|
/**
|
169
|
-
* @
|
172
|
+
* @openapi
|
170
173
|
* /api/v1/sso-traces/product:
|
171
174
|
* get:
|
172
|
-
* summary: Get all traces for a product
|
173
|
-
* parameters:
|
174
|
-
* - $ref: '#/parameters/product'
|
175
|
-
* - $ref: '#/parameters/pageOffset'
|
176
|
-
* - $ref: '#/parameters/pageLimit'
|
177
|
-
* - $ref: '#/parameters/pageToken'
|
178
175
|
* tags:
|
179
176
|
* - SSO Traces
|
180
|
-
*
|
181
|
-
*
|
177
|
+
* summary: Get all traces for a product
|
178
|
+
* parameters:
|
179
|
+
* - $ref: '#/components/parameters/product'
|
180
|
+
* - $ref: '#/components/parameters/pageOffset'
|
181
|
+
* - $ref: '#/components/parameters/pageLimit'
|
182
|
+
* - $ref: '#/components/parameters/pageToken'
|
182
183
|
* responses:
|
183
184
|
* '200':
|
184
185
|
* description: Success
|
@@ -190,7 +191,7 @@ class SSOTraces {
|
|
190
191
|
* data:
|
191
192
|
* type: array
|
192
193
|
* items:
|
193
|
-
* $ref: '#/
|
194
|
+
* $ref: '#/components/schemas/SSOTrace'
|
194
195
|
* pageToken:
|
195
196
|
* type: string
|
196
197
|
* description: token for pagination
|