auth0-deploy-cli 7.22.1 → 7.23.0
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/.nyc_output/2a2869c9-ac23-4d62-8266-903f9cdcd82e.json +1 -0
- package/.nyc_output/processinfo/2a2869c9-ac23-4d62-8266-903f9cdcd82e.json +1 -0
- package/.nyc_output/processinfo/ad53a51b-f5e5-41b3-9fb0-7f8a95a633c0.json +1 -0
- package/.nyc_output/processinfo/b691e3d3-398b-4603-a9ec-8843bc1cf98a.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/CHANGELOG.md +9 -1
- package/coverage/lcov-report/index.html +23 -23
- package/coverage/lcov.info +349 -131
- package/lib/commands/export.js +11 -0
- package/lib/commands/export.js.map +1 -1
- package/lib/commands/import.js +11 -0
- package/lib/commands/import.js.map +1 -1
- package/lib/tools/auth0/handlers/connections.d.ts +28 -0
- package/lib/tools/auth0/handlers/connections.js +24 -1
- package/lib/tools/auth0/handlers/connections.js.map +1 -1
- package/lib/tools/auth0/handlers/scimHandler.d.ts +77 -0
- package/lib/tools/auth0/handlers/scimHandler.js +235 -0
- package/lib/tools/auth0/handlers/scimHandler.js.map +1 -0
- package/package.json +1 -1
- package/.nyc_output/94f439c5-82c1-4677-911b-acfe6df86ed0.json +0 -1
- package/.nyc_output/processinfo/6902374f-0779-4fc5-9fb2-330ecb20b4f1.json +0 -1
- package/.nyc_output/processinfo/733605a0-5795-4855-9eb1-766bf48b40e8.json +0 -1
- package/.nyc_output/processinfo/94f439c5-82c1-4677-911b-acfe6df86ed0.json +0 -1
- /package/.nyc_output/{6902374f-0779-4fc5-9fb2-330ecb20b4f1.json → ad53a51b-f5e5-41b3-9fb0-7f8a95a633c0.json} +0 -0
- /package/.nyc_output/{733605a0-5795-4855-9eb1-766bf48b40e8.json → b691e3d3-398b-4603-a9ec-8843bc1cf98a.json} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import DefaultAPIHandler from './default';
|
|
2
2
|
import { CalculatedChanges, Asset, Assets } from '../../../types';
|
|
3
3
|
import { ConfigFunction } from '../../../configFactory';
|
|
4
|
+
import ScimHandler from './scimHandler';
|
|
4
5
|
export declare const schema: {
|
|
5
6
|
type: string;
|
|
6
7
|
items: {
|
|
@@ -30,6 +31,32 @@ export declare const schema: {
|
|
|
30
31
|
metadata: {
|
|
31
32
|
type: string;
|
|
32
33
|
};
|
|
34
|
+
scim_configuration: {
|
|
35
|
+
type: string;
|
|
36
|
+
properties: {
|
|
37
|
+
connection_name: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
mapping: {
|
|
41
|
+
type: string;
|
|
42
|
+
items: {
|
|
43
|
+
type: string;
|
|
44
|
+
properties: {
|
|
45
|
+
scim: {
|
|
46
|
+
type: string;
|
|
47
|
+
};
|
|
48
|
+
auth0: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
user_id_attribute: {
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
required: string[];
|
|
59
|
+
};
|
|
33
60
|
};
|
|
34
61
|
required: string[];
|
|
35
62
|
};
|
|
@@ -41,6 +68,7 @@ export declare const addExcludedConnectionPropertiesToChanges: ({ proposedChange
|
|
|
41
68
|
}) => CalculatedChanges;
|
|
42
69
|
export default class ConnectionsHandler extends DefaultAPIHandler {
|
|
43
70
|
existing: Asset[] | null;
|
|
71
|
+
scimHandler: ScimHandler;
|
|
44
72
|
constructor(config: DefaultAPIHandler);
|
|
45
73
|
objString(connection: any): string;
|
|
46
74
|
getFormattedOptions(connection: any, clients: any): {
|
|
@@ -46,6 +46,7 @@ const dot_prop_1 = __importDefault(require("dot-prop"));
|
|
|
46
46
|
const lodash_1 = __importDefault(require("lodash"));
|
|
47
47
|
const default_1 = __importStar(require("./default"));
|
|
48
48
|
const utils_1 = require("../../utils");
|
|
49
|
+
const scimHandler_1 = __importDefault(require("./scimHandler"));
|
|
49
50
|
exports.schema = {
|
|
50
51
|
type: 'array',
|
|
51
52
|
items: {
|
|
@@ -57,6 +58,15 @@ exports.schema = {
|
|
|
57
58
|
enabled_clients: { type: 'array', items: { type: 'string' } },
|
|
58
59
|
realms: { type: 'array', items: { type: 'string' } },
|
|
59
60
|
metadata: { type: 'object' },
|
|
61
|
+
scim_configuration: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
connection_name: { type: 'string' },
|
|
65
|
+
mapping: { type: 'array', items: { type: 'object', properties: { scim: { type: 'string' }, auth0: { type: 'string' } } } },
|
|
66
|
+
user_id_attribute: { type: 'string' }
|
|
67
|
+
},
|
|
68
|
+
required: ['mapping', 'user_id_attribute'],
|
|
69
|
+
}
|
|
60
70
|
},
|
|
61
71
|
required: ['name', 'strategy'],
|
|
62
72
|
},
|
|
@@ -95,7 +105,16 @@ const addExcludedConnectionPropertiesToChanges = ({ proposedChanges, existingCon
|
|
|
95
105
|
exports.addExcludedConnectionPropertiesToChanges = addExcludedConnectionPropertiesToChanges;
|
|
96
106
|
class ConnectionsHandler extends default_1.default {
|
|
97
107
|
constructor(config) {
|
|
98
|
-
super(Object.assign(Object.assign({}, config), { type: 'connections', stripUpdateFields: ['strategy', 'name']
|
|
108
|
+
super(Object.assign(Object.assign({}, config), { type: 'connections', stripUpdateFields: ['strategy', 'name'], functions: {
|
|
109
|
+
// When `connections` is updated, it can result in `update`,`create` or `delete` action on SCIM.
|
|
110
|
+
// Because, `scim_configuration` is inside `connections`.
|
|
111
|
+
update: (requestParams, bodyParams) => __awaiter(this, void 0, void 0, function* () { return yield this.scimHandler.updateOverride(requestParams, bodyParams); }),
|
|
112
|
+
// When a new `connection` is created. We can perform only `create` option on SCIM.
|
|
113
|
+
// When a connection is `deleted`. `scim_configuration` is also deleted along with it; no action on SCIM is required.
|
|
114
|
+
create: (bodyParams) => __awaiter(this, void 0, void 0, function* () { return yield this.scimHandler.createOverride(bodyParams); })
|
|
115
|
+
} }));
|
|
116
|
+
// @ts-ignore
|
|
117
|
+
this.scimHandler = new scimHandler_1.default(this.config, this.client.tokenProvider, this.client.connections);
|
|
99
118
|
}
|
|
100
119
|
objString(connection) {
|
|
101
120
|
return super.objString({ name: connection.name, id: connection.id });
|
|
@@ -122,6 +141,8 @@ class ConnectionsHandler extends default_1.default {
|
|
|
122
141
|
this.existing = connections.filter((c) => c.strategy !== 'auth0');
|
|
123
142
|
if (this.existing === null)
|
|
124
143
|
return [];
|
|
144
|
+
// Apply `scim_configuration` to all the relevant `SCIM` connections. This method mutates `this.existing`.
|
|
145
|
+
yield this.scimHandler.applyScimConfiguration(this.existing);
|
|
125
146
|
return this.existing;
|
|
126
147
|
});
|
|
127
148
|
}
|
|
@@ -145,6 +166,8 @@ class ConnectionsHandler extends default_1.default {
|
|
|
145
166
|
paginate: true,
|
|
146
167
|
include_totals: true,
|
|
147
168
|
});
|
|
169
|
+
// Prepare an id map. We'll use this map later to get the `strategy` and SCIM enable status of the connections.
|
|
170
|
+
yield this.scimHandler.createIdMap(existingConnections);
|
|
148
171
|
const formatted = connections.map((connection) => (Object.assign(Object.assign(Object.assign({}, connection), this.getFormattedOptions(connection, clients)), { enabled_clients: (0, utils_1.getEnabledClients)(assets, connection, existingConnections, clients) })));
|
|
149
172
|
const proposedChanges = yield _super.calcChanges.call(this, Object.assign(Object.assign({}, assets), { connections: formatted }));
|
|
150
173
|
const proposedChangesWithExcludedProperties = (0, exports.addExcludedConnectionPropertiesToChanges)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../../../src/tools/auth0/handlers/connections.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA+B;AAC/B,oDAAuB;AACvB,qDAAqD;AACrD,uCAAuF;
|
|
1
|
+
{"version":3,"file":"connections.js","sourceRoot":"","sources":["../../../../src/tools/au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ponse } from 'axios';
|
|
3
|
+
interface scimRequestParams {
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
interface scimBodyParams {
|
|
7
|
+
user_id_attribute: string;
|
|
8
|
+
mapping: {
|
|
9
|
+
scim: string;
|
|
10
|
+
auth0: string;
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The current version of this sdk use `node-auth0` v3. But `SCIM` features are not natively supported by v3.
|
|
15
|
+
* This is a workaround to make this SDK support SCIM without `node-auth0` upgrade.
|
|
16
|
+
*/
|
|
17
|
+
export default class ScimHandler {
|
|
18
|
+
private idMap;
|
|
19
|
+
private readonly scimStrategies;
|
|
20
|
+
private tokenProvider;
|
|
21
|
+
private config;
|
|
22
|
+
private connectionsManager;
|
|
23
|
+
constructor(config: any, tokenProvider: any, connectionsManager: any);
|
|
24
|
+
/**
|
|
25
|
+
* Check if the connection strategy is SCIM supported.
|
|
26
|
+
* Only few of the enterprise connections are SCIM supported.
|
|
27
|
+
*/
|
|
28
|
+
isScimStrategy(strategy: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Creates connection_id -> { strategy, hasConfig } map.
|
|
31
|
+
* Store only the SCIM ids available on the existing / remote config.
|
|
32
|
+
* Payload received on `create` and `update` methods has the property `strategy` stripped.
|
|
33
|
+
* So, we need this map to perform `create`, `update` or `delete` actions on SCIM.
|
|
34
|
+
* @param connections
|
|
35
|
+
*/
|
|
36
|
+
createIdMap(connections: Asset[]): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Iterate through all the connections and add property `scim_configuration` to only `SCIM` connections.
|
|
39
|
+
* The following conditions should be met to have `scim_configuration` set to a `connection`.
|
|
40
|
+
* 1. Connection `strategy` should be one of `scimStrategies`
|
|
41
|
+
* 2. Connection should have `SCIM` enabled.
|
|
42
|
+
*
|
|
43
|
+
* This method mutates the incoming `connections`.
|
|
44
|
+
*/
|
|
45
|
+
applyScimConfiguration(connections: Asset[]): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* HTTP request wrapper on axios.
|
|
48
|
+
*/
|
|
49
|
+
private scimHttpRequest;
|
|
50
|
+
/**
|
|
51
|
+
* Error handler wrapper.
|
|
52
|
+
*/
|
|
53
|
+
withErrorHandling(callback: any): Promise<any>;
|
|
54
|
+
/**
|
|
55
|
+
* Returns formatted endpoint url.
|
|
56
|
+
*/
|
|
57
|
+
private getScimEndpoint;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a new `SCIM` configuration.
|
|
60
|
+
*/
|
|
61
|
+
createScimConfiguration({ id: connection_id }: scimRequestParams, { user_id_attribute, mapping }: scimBodyParams): Promise<AxiosResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Retrieves `SCIM` configuration of an enterprise connection.
|
|
64
|
+
*/
|
|
65
|
+
getScimConfiguration({ id: connection_id }: scimRequestParams): Promise<scimBodyParams>;
|
|
66
|
+
/**
|
|
67
|
+
* Updates an existing `SCIM` configuration.
|
|
68
|
+
*/
|
|
69
|
+
updateScimConfiguration({ id: connection_id }: scimRequestParams, { user_id_attribute, mapping }: scimBodyParams): Promise<AxiosResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* Deletes an existing `SCIM` configuration.
|
|
72
|
+
*/
|
|
73
|
+
deleteScimConfiguration({ id: connection_id }: scimRequestParams): Promise<AxiosResponse>;
|
|
74
|
+
updateOverride(requestParams: scimRequestParams, bodyParams: Asset): Promise<any>;
|
|
75
|
+
createOverride(bodyParams: Asset): Promise<any>;
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,235 @@
|
|
|
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
|
+
const axios_1 = __importDefault(require("axios"));
|
|
16
|
+
const logger_1 = __importDefault(require("../../../logger"));
|
|
17
|
+
const utils_1 = require("../../utils");
|
|
18
|
+
/**
|
|
19
|
+
* The current version of this sdk use `node-auth0` v3. But `SCIM` features are not natively supported by v3.
|
|
20
|
+
* This is a workaround to make this SDK support SCIM without `node-auth0` upgrade.
|
|
21
|
+
*/
|
|
22
|
+
class ScimHandler {
|
|
23
|
+
constructor(config, tokenProvider, connectionsManager) {
|
|
24
|
+
this.scimStrategies = ['samlp', 'oidc', 'okta', 'waad'];
|
|
25
|
+
this.config = config;
|
|
26
|
+
this.tokenProvider = tokenProvider;
|
|
27
|
+
this.connectionsManager = connectionsManager;
|
|
28
|
+
this.idMap = new Map();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Check if the connection strategy is SCIM supported.
|
|
32
|
+
* Only few of the enterprise connections are SCIM supported.
|
|
33
|
+
*/
|
|
34
|
+
isScimStrategy(strategy) {
|
|
35
|
+
return this.scimStrategies.includes(strategy.toLowerCase());
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates connection_id -> { strategy, hasConfig } map.
|
|
39
|
+
* Store only the SCIM ids available on the existing / remote config.
|
|
40
|
+
* Payload received on `create` and `update` methods has the property `strategy` stripped.
|
|
41
|
+
* So, we need this map to perform `create`, `update` or `delete` actions on SCIM.
|
|
42
|
+
* @param connections
|
|
43
|
+
*/
|
|
44
|
+
createIdMap(connections) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
this.idMap.clear();
|
|
47
|
+
for (let connection of connections) {
|
|
48
|
+
if (!this.isScimStrategy(connection.strategy))
|
|
49
|
+
continue;
|
|
50
|
+
try {
|
|
51
|
+
this.idMap.set(connection.id, { strategy: connection.strategy, hasConfig: false });
|
|
52
|
+
yield this.getScimConfiguration({ id: connection.id });
|
|
53
|
+
this.idMap.set(connection.id, Object.assign(Object.assign({}, this.idMap.get(connection.id)), { hasConfig: true }));
|
|
54
|
+
// To avoid rate limiter error, we making API requests with a small delay.
|
|
55
|
+
// TODO: However, this logic needs to be re-worked.
|
|
56
|
+
yield (0, utils_1.sleep)(500);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
// Skip the connection if it returns 404. This can happen if `SCIM` is not enabled on a `SCIM` connection.
|
|
60
|
+
if (err !== 'SCIM_NOT_FOUND')
|
|
61
|
+
throw err;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Iterate through all the connections and add property `scim_configuration` to only `SCIM` connections.
|
|
68
|
+
* The following conditions should be met to have `scim_configuration` set to a `connection`.
|
|
69
|
+
* 1. Connection `strategy` should be one of `scimStrategies`
|
|
70
|
+
* 2. Connection should have `SCIM` enabled.
|
|
71
|
+
*
|
|
72
|
+
* This method mutates the incoming `connections`.
|
|
73
|
+
*/
|
|
74
|
+
applyScimConfiguration(connections) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
for (let connection of connections) {
|
|
77
|
+
if (!this.isScimStrategy(connection.strategy))
|
|
78
|
+
continue;
|
|
79
|
+
try {
|
|
80
|
+
const { user_id_attribute, mapping } = yield this.getScimConfiguration({ id: connection.id });
|
|
81
|
+
connection.scim_configuration = { user_id_attribute, mapping };
|
|
82
|
+
// To avoid rate limiter error, we making API requests with a small delay.
|
|
83
|
+
// TODO: However, this logic needs to be re-worked.
|
|
84
|
+
yield (0, utils_1.sleep)(500);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
// Skip the connection if it returns 404. This can happen if `SCIM` is not enabled on a `SCIM` connection.
|
|
88
|
+
if (err !== 'SCIM_NOT_FOUND')
|
|
89
|
+
throw err;
|
|
90
|
+
const warningMessage = `SCIM configuration not found on connection \"${connection.id}\".`;
|
|
91
|
+
logger_1.default.warn(warningMessage);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* HTTP request wrapper on axios.
|
|
98
|
+
*/
|
|
99
|
+
scimHttpRequest(method, options) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
return yield this.withErrorHandling(() => __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
var _a;
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
const accessToken = yield ((_a = this.tokenProvider) === null || _a === void 0 ? void 0 : _a.getAccessToken());
|
|
105
|
+
const headers = {
|
|
106
|
+
'Accept': 'application/json',
|
|
107
|
+
'Authorization': `Bearer ${accessToken}`
|
|
108
|
+
};
|
|
109
|
+
options = [...options, { headers }];
|
|
110
|
+
return yield axios_1.default[method](...options);
|
|
111
|
+
}));
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Error handler wrapper.
|
|
116
|
+
*/
|
|
117
|
+
withErrorHandling(callback) {
|
|
118
|
+
var _a, _b, _c, _d;
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
try {
|
|
121
|
+
return yield callback();
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
const errorData = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
125
|
+
if ((errorData === null || errorData === void 0 ? void 0 : errorData.statusCode) === 404)
|
|
126
|
+
throw "SCIM_NOT_FOUND";
|
|
127
|
+
const statusCode = (errorData === null || errorData === void 0 ? void 0 : errorData.statusCode) || ((_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.status);
|
|
128
|
+
const errorCode = (errorData === null || errorData === void 0 ? void 0 : errorData.errorCode) || (errorData === null || errorData === void 0 ? void 0 : errorData.error) || ((_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.statusText);
|
|
129
|
+
const errorMessage = (errorData === null || errorData === void 0 ? void 0 : errorData.message) || ((_d = error === null || error === void 0 ? void 0 : error.response) === null || _d === void 0 ? void 0 : _d.statusText);
|
|
130
|
+
const message = `SCIM request failed with statusCode ${statusCode} (${errorCode}). ${errorMessage}.`;
|
|
131
|
+
logger_1.default.error(message);
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Returns formatted endpoint url.
|
|
138
|
+
*/
|
|
139
|
+
getScimEndpoint(connection_id) {
|
|
140
|
+
// Call `scim-configuration` endpoint directly to support `SCIM` features.
|
|
141
|
+
return `https://${this.config('AUTH0_DOMAIN')}/api/v2/connections/${connection_id}/scim-configuration`;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Creates a new `SCIM` configuration.
|
|
145
|
+
*/
|
|
146
|
+
createScimConfiguration({ id: connection_id }, { user_id_attribute, mapping }) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
logger_1.default.debug(`Creating SCIM configuration for connection ${connection_id}`);
|
|
149
|
+
const url = this.getScimEndpoint(connection_id);
|
|
150
|
+
return (yield this.scimHttpRequest('post', [url, { user_id_attribute, mapping }])).data;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Retrieves `SCIM` configuration of an enterprise connection.
|
|
155
|
+
*/
|
|
156
|
+
getScimConfiguration({ id: connection_id }) {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
logger_1.default.debug(`Getting SCIM configuration from connection ${connection_id}`);
|
|
159
|
+
const url = this.getScimEndpoint(connection_id);
|
|
160
|
+
return (yield this.scimHttpRequest('get', [url])).data;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Updates an existing `SCIM` configuration.
|
|
165
|
+
*/
|
|
166
|
+
updateScimConfiguration({ id: connection_id }, { user_id_attribute, mapping }) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
logger_1.default.debug(`Updating SCIM configuration on connection ${connection_id}`);
|
|
169
|
+
const url = this.getScimEndpoint(connection_id);
|
|
170
|
+
return (yield this.scimHttpRequest('patch', [url, { user_id_attribute, mapping }])).data;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Deletes an existing `SCIM` configuration.
|
|
175
|
+
*/
|
|
176
|
+
deleteScimConfiguration({ id: connection_id }) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
logger_1.default.debug(`Deleting SCIM configuration of connection ${connection_id}`);
|
|
179
|
+
const url = this.getScimEndpoint(connection_id);
|
|
180
|
+
return (yield this.scimHttpRequest('delete', [url])).data;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
updateOverride(requestParams, bodyParams) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
// Extract `scim_configuration` from `bodyParams`.
|
|
186
|
+
// Remove `scim_configuration` from `bodyParams`, because `connections.update` doesn't accept it.
|
|
187
|
+
const { scim_configuration: scimBodyParams } = bodyParams;
|
|
188
|
+
delete bodyParams.scim_configuration;
|
|
189
|
+
// First, update `connections`.
|
|
190
|
+
const updated = yield this.connectionsManager.update(requestParams, bodyParams);
|
|
191
|
+
const idMapEntry = this.idMap.get(requestParams.id);
|
|
192
|
+
// Now, update `scim_configuration` inside the updated connection.
|
|
193
|
+
// If `scim_configuration` exists in both local and remote -> updateScimConfiguration(...)
|
|
194
|
+
// If `scim_configuration` exists in remote but local -> deleteScimConfiguration(...)
|
|
195
|
+
// If `scim_configuration` exists in local but remote -> createScimConfiguration(...)
|
|
196
|
+
if (idMapEntry === null || idMapEntry === void 0 ? void 0 : idMapEntry.hasConfig) {
|
|
197
|
+
if (scimBodyParams) {
|
|
198
|
+
yield this.updateScimConfiguration(requestParams, scimBodyParams);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
if (this.config('AUTH0_ALLOW_DELETE')) {
|
|
202
|
+
logger_1.default.warn(`Deleting scim_configuration on connection ${requestParams.id}.`);
|
|
203
|
+
yield this.deleteScimConfiguration(requestParams);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
logger_1.default.warn('Skipping DELETE scim_configuration. Enable deletes by setting AUTH0_ALLOW_DELETE to true in your config.');
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
else if (scimBodyParams) {
|
|
211
|
+
yield this.createScimConfiguration(requestParams, scimBodyParams);
|
|
212
|
+
}
|
|
213
|
+
// Return response from connections.update(...).
|
|
214
|
+
return updated;
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
createOverride(bodyParams) {
|
|
218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
// Extract `scim_configuration` from `bodyParams`.
|
|
220
|
+
// Remove `scim_configuration` from `bodyParams`, because `connections.create` doesn't accept it.
|
|
221
|
+
const { scim_configuration: scimBodyParams } = bodyParams;
|
|
222
|
+
delete bodyParams.scim_configuration;
|
|
223
|
+
// First, create the new `connection`.
|
|
224
|
+
const created = yield this.connectionsManager.create(bodyParams);
|
|
225
|
+
if (scimBodyParams) {
|
|
226
|
+
// Now, create the `scim_configuration` for newly created `connection`.
|
|
227
|
+
yield this.createScimConfiguration({ id: created.id }, scimBodyParams);
|
|
228
|
+
}
|
|
229
|
+
// Return response from connections.create(...).
|
|
230
|
+
return created;
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
exports.default = ScimHandler;
|
|
235
|
+
//# sourceMappingURL=scimHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scimHandler.js","sourceRoot":"","sources":["../../../../src/tools/auth0/handlers/scimHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,kDAA6C;AAC7C,6DAAkC;AAClC,uCAAoC;AAgBpC;;;GAGG;AACH,MAAqB,WAAW;IAO/B,YAAY,MAAM,EAAE,aAAa,EAAE,kBAAkB;QALpC,mBAAc,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAMnE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;QAC7C,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,cAAc,CAAC,QAAgB;QAC9B,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACG,WAAW,CAAC,WAAoB;;YACrC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAEnB,KAAK,IAAI,UAAU,IAAI,WAAW,EAAE;gBACnC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC;oBAAE,SAAS;gBAExD,IAAI;oBACH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;oBACnF,MAAM,IAAI,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,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