@rockcarver/frodo-lib 0.19.2 → 1.0.1-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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdminFederationOps.js","names":["_AdminFederationProvidersApi","require","_ExportImportUtils","_Console","_IdmConfigApi","asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","ADMIN_FED_CONFIG_ID_PREFIX","createAdminFederationExportTemplate","meta","getMetadata","config","idp","getAdminFederationProviders","_getAdminFederationProviders2","result","_getAdminFederationProviders","getAdminFederationProvider","_x","_getAdminFederationProvider","providerId","response","foundProviders","filter","provider","_id","length","Error","concat","putProviderByTypeAndId","_x2","_x3","_x4","_putProviderByTypeAndId2","providerType","providerData","debugMessage","_putProviderByTypeAndId","importError","_importError$response","_importError$response2","_importError$response3","status","data","message","validAttributes","detail","push","attribute","Object","keys","includes","deleteAdminFederationProvider","_x5","_deleteAdminFederationProvider","deleteProviderByTypeAndId","_type","exportAdminFederationProvider","_x6","_exportAdminFederationProvider","exportData","errors","idpData","idpConfig","getConfigEntity","errorMessages","map","join","exportAdminFederationProviders","_exportAdminFederationProviders","allIdpsData","importAdminFederationProvider","_x7","_x8","_importAdminFederationProvider","importData","imported","idpId","configId","putConfigEntity","importFirstAdminFederationProvider","_x9","_importFirstAdminFederationProvider","importAdminFederationProviders","_x10","_importAdminFederationProviders"],"sources":["ops/cloud/AdminFederationOps.ts"],"sourcesContent":["import {\n deleteProviderByTypeAndId,\n getAdminFederationProviders as _getAdminFederationProviders,\n putProviderByTypeAndId as _putProviderByTypeAndId,\n} from '../../api/cloud/AdminFederationProvidersApi';\nimport { ExportMetaData } from '../OpsTypes';\nimport {\n AdminFederationConfigSkeleton,\n SocialIdpSkeleton,\n} from '../../api/ApiTypes';\nimport { getMetadata } from '../utils/ExportImportUtils';\nimport { debugMessage } from '../utils/Console';\nimport { getConfigEntity, putConfigEntity } from '../../api/IdmConfigApi';\n\nexport interface AdminFederationExportInterface {\n meta?: ExportMetaData;\n config: Record<string, AdminFederationConfigSkeleton>;\n idp: Record<string, SocialIdpSkeleton>;\n}\n\nconst ADMIN_FED_CONFIG_ID_PREFIX = 'fidc/federation-';\n\n/**\n * Create an empty idp export template\n * @returns {AdminFederationExportInterface} an empty idp export template\n */\nfunction createAdminFederationExportTemplate(): AdminFederationExportInterface {\n return {\n meta: getMetadata(),\n config: {},\n idp: {},\n } as AdminFederationExportInterface;\n}\n\n/**\n * Get all admin federation providers\n * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers\n */\nexport async function getAdminFederationProviders() {\n const { result } = await _getAdminFederationProviders();\n return result;\n}\n\n/**\n * Get admin federation provider by id\n * @param {String} providerId social identity provider id/name\n * @returns {Promise} a promise that resolves a social admin federation object\n */\nexport async function getAdminFederationProvider(providerId) {\n const response = await getAdminFederationProviders();\n const foundProviders = response.filter(\n (provider) => provider._id === providerId\n );\n switch (foundProviders.length) {\n case 1:\n return foundProviders[0];\n case 0:\n throw new Error(`Provider '${providerId}' not found`);\n default:\n throw new Error(\n `${foundProviders.length} providers '${providerId}' found`\n );\n }\n}\n\nexport async function putProviderByTypeAndId(\n providerType: string,\n providerId: string,\n providerData: object\n) {\n debugMessage(`AdminFederationOps.putProviderByTypeAndId: start`);\n try {\n const response = await _putProviderByTypeAndId(\n providerType,\n providerId,\n providerData\n );\n debugMessage(`AdminFederationOps.putProviderByTypeAndId: end`);\n return response;\n } catch (importError) {\n if (\n importError.response?.status === 400 &&\n importError.response?.data?.message === 'Invalid attribute specified.'\n ) {\n const { validAttributes } = importError.response.data.detail;\n validAttributes.push('_id', '_type');\n for (const attribute of Object.keys(providerData)) {\n if (!validAttributes.includes(attribute)) {\n debugMessage(`Removing invalid attribute: ${attribute}`);\n delete providerData[attribute];\n }\n }\n const response = await _putProviderByTypeAndId(\n providerType,\n providerId,\n providerData\n );\n debugMessage(\n `AdminFederationOps.putProviderByTypeAndId: end (after retry)`\n );\n return response;\n } else {\n // re-throw unhandleable error\n throw importError;\n }\n }\n}\n\n/**\n * Delete admin federation provider by id\n * @param {String} providerId admin federation provider id/name\n * @returns {Promise} a promise that resolves to an admin federation provider object\n */\nexport async function deleteAdminFederationProvider(\n providerId: string\n): Promise<unknown> {\n const response = await getAdminFederationProviders();\n const foundProviders = response.filter(\n (provider) => provider._id === providerId\n );\n switch (foundProviders.length) {\n case 1:\n return await deleteProviderByTypeAndId(\n foundProviders[0]._type._id,\n foundProviders[0]._id\n );\n case 0:\n throw new Error(`Provider '${providerId}' not found`);\n default:\n throw new Error(\n `${foundProviders.length} providers '${providerId}' found`\n );\n }\n}\n\n/**\n * Export admin federation provider by id\n * @param {string} providerId provider id/name\n * @returns {Promise<AdminFederationExportInterface>} a promise that resolves to a SocialProviderExportInterface object\n */\nexport async function exportAdminFederationProvider(\n providerId: string\n): Promise<AdminFederationExportInterface> {\n debugMessage(`AdminFederationOps.exportAdminFederationProvider: start`);\n const exportData = createAdminFederationExportTemplate();\n const errors = [];\n try {\n const idpData = await getAdminFederationProvider(providerId);\n exportData.idp[idpData._id] = idpData;\n const idpConfig = await getConfigEntity(\n `${ADMIN_FED_CONFIG_ID_PREFIX}${providerId}`\n );\n exportData.config[idpConfig._id] = idpConfig;\n } catch (error) {\n errors.push(error);\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Export error:\\n${errorMessages}`);\n }\n debugMessage(`AdminFederationOps.exportAdminFederationProvider: end`);\n return exportData;\n}\n\n/**\n * Export all providers\n * @returns {Promise<AdminFederationExportInterface>} a promise that resolves to a SocialProviderExportInterface object\n */\nexport async function exportAdminFederationProviders(): Promise<AdminFederationExportInterface> {\n debugMessage(`AdminFederationOps.exportAdminFederationProviders: start`);\n const exportData = createAdminFederationExportTemplate();\n const errors = [];\n try {\n const allIdpsData = await getAdminFederationProviders();\n for (const idpData of allIdpsData) {\n try {\n exportData.idp[idpData._id] = idpData;\n const idpConfig = await getConfigEntity(\n `${ADMIN_FED_CONFIG_ID_PREFIX}${idpData._id}`\n );\n exportData.config[idpConfig._id] = idpConfig;\n } catch (error) {\n errors.push(error);\n }\n }\n } catch (error) {\n errors.push(error);\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Export error:\\n${errorMessages}`);\n }\n debugMessage(`AdminFederationOps.exportAdminFederationProviders: end`);\n return exportData;\n}\n\n/**\n * Import admin federation provider by id/name\n * @param {string} providerId provider id/name\n * @param {AdminFederationExportInterface} importData import data\n */\nexport async function importAdminFederationProvider(\n providerId: string,\n importData: AdminFederationExportInterface\n): Promise<SocialIdpSkeleton> {\n let response = null;\n const errors = [];\n const imported = [];\n for (const idpId of Object.keys(importData.idp)) {\n if (idpId === providerId) {\n try {\n response = await putProviderByTypeAndId(\n importData.idp[idpId]._type._id,\n idpId,\n importData.idp[idpId]\n );\n const configId = `${ADMIN_FED_CONFIG_ID_PREFIX}${idpId}`;\n if (importData.config[configId]) {\n await putConfigEntity(configId, importData.config[configId]);\n }\n imported.push(idpId);\n } catch (error) {\n errors.push(error);\n }\n }\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Import error:\\n${errorMessages}`);\n }\n if (0 === imported.length) {\n throw new Error(`Import error:\\n${providerId} not found in import data!`);\n }\n return response;\n}\n\n/**\n * Import first provider\n * @param {AdminFederationExportInterface} importData import data\n */\nexport async function importFirstAdminFederationProvider(\n importData: AdminFederationExportInterface\n): Promise<SocialIdpSkeleton> {\n let response = null;\n const errors = [];\n const imported = [];\n for (const idpId of Object.keys(importData.idp)) {\n try {\n response = await putProviderByTypeAndId(\n importData.idp[idpId]._type._id,\n idpId,\n importData.idp[idpId]\n );\n const configId = `${ADMIN_FED_CONFIG_ID_PREFIX}${idpId}`;\n if (importData.config[configId]) {\n await putConfigEntity(configId, importData.config[configId]);\n }\n imported.push(idpId);\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Import error:\\n${errorMessages}`);\n }\n if (0 === imported.length) {\n throw new Error(`Import error:\\nNo providers found in import data!`);\n }\n return response;\n}\n\n/**\n * Import all providers\n * @param {AdminFederationExportInterface} importData import data\n */\nexport async function importAdminFederationProviders(\n importData: AdminFederationExportInterface\n): Promise<SocialIdpSkeleton[]> {\n const response = [];\n const errors = [];\n const imported = [];\n for (const idpId of Object.keys(importData.idp)) {\n try {\n response.push(\n await putProviderByTypeAndId(\n importData.idp[idpId]._type._id,\n idpId,\n importData.idp[idpId]\n )\n );\n const configId = `${ADMIN_FED_CONFIG_ID_PREFIX}${idpId}`;\n if (importData.config[configId]) {\n await putConfigEntity(configId, importData.config[configId]);\n }\n imported.push(idpId);\n } catch (error) {\n errors.push(error);\n }\n }\n if (errors.length) {\n const errorMessages = errors.map((error) => error.message).join('\\n');\n throw new Error(`Import error:\\n${errorMessages}`);\n }\n if (0 === imported.length) {\n throw new Error(`Import error:\\nNo providers found in import data!`);\n }\n return response;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,4BAAA,GAAAC,OAAA;AAUA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAA0E,SAAAI,mBAAAC,GAAA,EAAAC,OAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,GAAA,EAAAC,GAAA,cAAAC,IAAA,GAAAP,GAAA,CAAAK,GAAA,EAAAC,GAAA,OAAAE,KAAA,GAAAD,IAAA,CAAAC,KAAA,WAAAC,KAAA,IAAAP,MAAA,CAAAO,KAAA,iBAAAF,IAAA,CAAAG,IAAA,IAAAT,OAAA,CAAAO,KAAA,YAAAG,OAAA,CAAAV,OAAA,CAAAO,KAAA,EAAAI,IAAA,CAAAT,KAAA,EAAAC,MAAA;AAAA,SAAAS,k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CAAChE,MAAM,CAACmE,QAAQ,CAAC,CAAC;QAC9D;QACAF,QAAQ,CAAC7B,IAAI,CAAC8B,KAAK,CAAC;MACtB,CAAC,CAAC,OAAOlF,KAAK,EAAE;QACdkE,MAAM,CAACd,IAAI,CAACpD,KAAK,CAAC;MACpB;IACF;IACA,IAAIkE,MAAM,CAACnC,MAAM,EAAE;MACjB,IAAMuC,aAAa,GAAGJ,MAAM,CAACK,GAAG,CAAEvE,KAAK,IAAKA,KAAK,CAACiD,OAAO,CAAC,CAACuB,IAAI,CAAC,IAAI,CAAC;MACrE,MAAM,IAAIxC,KAAK,mBAAAC,MAAA,CAAmBqC,aAAa,CAAE,CAAC;IACpD;IACA,IAAI,CAAC,KAAKW,QAAQ,CAAClD,MAAM,EAAE;MACzB,MAAM,IAAIC,KAAK,oDAAoD,CAAC;IACtE;IACA,OAAON,QAAQ;EACjB,CAAC;EAAA,OAAAgE,+BAAA,CAAAjF,KAAA,OAAAD,SAAA;AAAA"}
@@ -0,0 +1,112 @@
1
+ import util from 'util';
2
+ import { generateAmApi } from '../BaseApi';
3
+ import { deleteDeepByKey, getRealmPath } from '../utils/ApiUtils';
4
+ import * as state from '../../shared/State';
5
+ const getAllProviderTypesURLTemplate = '%s/json%s/realm-config/services/SocialIdentityProviders?_action=getAllTypes';
6
+ const providerByTypeAndIdURLTemplate = '%s/json%s/realm-config/services/SocialIdentityProviders/%s/%s';
7
+ const getAllProvidersURLTemplate = '%s/json%s/realm-config/services/SocialIdentityProviders?_action=nextdescendents';
8
+ const getProvidersByTypeURLTemplate = '%s/json%s/realm-config/services/SocialIdentityProviders/%s?_queryFilter=true';
9
+ const apiVersion = 'protocol=2.1,resource=1.0';
10
+ const getApiConfig = () => {
11
+ const configPath = getRealmPath('/');
12
+ return {
13
+ path: `${configPath}/realm-config/services/SocialIdentityProviders`,
14
+ apiVersion
15
+ };
16
+ };
17
+
18
+ /**
19
+ * Get admin federation provider types
20
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation provider types
21
+ */
22
+ export async function getAdminFederationProviderTypes() {
23
+ const urlString = util.format(getAllProviderTypesURLTemplate, state.getHost(), getRealmPath('/'));
24
+ const {
25
+ data
26
+ } = await generateAmApi(getApiConfig()).get(urlString, {
27
+ withCredentials: true
28
+ });
29
+ return data;
30
+ }
31
+
32
+ /**
33
+ * Get admin federation providers by type
34
+ * @param {String} type admin federation provider type
35
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers of the requested type
36
+ */
37
+ export async function getAdminFederationProvidersByType(type) {
38
+ const urlString = util.format(getProvidersByTypeURLTemplate, state.getHost(), getRealmPath('/'), type);
39
+ const {
40
+ data
41
+ } = await generateAmApi(getApiConfig()).get(urlString, {
42
+ withCredentials: true
43
+ });
44
+ return data;
45
+ }
46
+
47
+ /**
48
+ * Get all admin federation providers
49
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers
50
+ */
51
+ export async function getAdminFederationProviders() {
52
+ const urlString = util.format(getAllProvidersURLTemplate, state.getHost(), getRealmPath('/'));
53
+ const {
54
+ data
55
+ } = await generateAmApi(getApiConfig()).post(urlString, {}, {
56
+ withCredentials: true
57
+ });
58
+ return data;
59
+ }
60
+
61
+ /**
62
+ * Get admin federation provider by type and id
63
+ * @param {*} type admin federation provider type
64
+ * @param {*} id admin federation provider id/name
65
+ * @returns {Promise} a promise that resolves to an object containing a admin federation provider
66
+ */
67
+ export async function getProviderByTypeAndId(type, id) {
68
+ const urlString = util.format(providerByTypeAndIdURLTemplate, state.getHost(), getRealmPath('/'), type, id);
69
+ const {
70
+ data
71
+ } = await generateAmApi(getApiConfig()).get(urlString, {
72
+ withCredentials: true
73
+ });
74
+ return data;
75
+ }
76
+
77
+ /**
78
+ * Get admin federation provider by type and id
79
+ * @param {String} type admin federation provider type
80
+ * @param {String} id admin federation provider id/name
81
+ * @param {Object} providerData a admin federation provider object
82
+ * @returns {Promise} a promise that resolves to an object containing a admin federation provider
83
+ */
84
+ export async function putProviderByTypeAndId(type, id, providerData) {
85
+ // until we figure out a way to use transport keys in Frodo,
86
+ // we'll have to drop those encrypted attributes.
87
+ const cleanData = deleteDeepByKey(providerData, '-encrypted');
88
+ const urlString = util.format(providerByTypeAndIdURLTemplate, state.getHost(), getRealmPath('/'), type, id);
89
+ const {
90
+ data
91
+ } = await generateAmApi(getApiConfig()).put(urlString, cleanData, {
92
+ withCredentials: true
93
+ });
94
+ return data;
95
+ }
96
+
97
+ /**
98
+ * Delete admin federation provider by type and id
99
+ * @param {string} providerId provider type
100
+ * @param {string} providerId provider id
101
+ * @returns {Promise<unknown>} a promise that resolves to a admin federation provider
102
+ */
103
+ export async function deleteProviderByTypeAndId(type, providerId) {
104
+ const urlString = util.format(providerByTypeAndIdURLTemplate, state.getHost(), getRealmPath('/'), type, providerId);
105
+ const {
106
+ data
107
+ } = await generateAmApi(getApiConfig()).delete(urlString, {
108
+ withCredentials: true
109
+ });
110
+ return data;
111
+ }
112
+ //# sourceMappingURL=AdminFederationProvidersApi.js.map
package/esm/index.mjs CHANGED
@@ -19,6 +19,7 @@ export * as IdmConfigRaw from './api/IdmConfigApi';
19
19
 
20
20
  // Ops Layer
21
21
  export * as Admin from './ops/AdminOps';
22
+ export * as AdminFederation from './ops/cloud/AdminFederationOps';
22
23
  export * as Agent from './ops/AgentOps';
23
24
  export * as Authenticate from './ops/AuthenticateOps';
24
25
  export * as CirclesOfTrust from './ops/CirclesOfTrustOps';
@@ -0,0 +1,241 @@
1
+ import { deleteProviderByTypeAndId, getAdminFederationProviders as _getAdminFederationProviders, putProviderByTypeAndId as _putProviderByTypeAndId } from '../../api/cloud/AdminFederationProvidersApi';
2
+ import { getMetadata } from '../utils/ExportImportUtils';
3
+ import { debugMessage } from '../utils/Console';
4
+ import { getConfigEntity, putConfigEntity } from '../../api/IdmConfigApi';
5
+ const ADMIN_FED_CONFIG_ID_PREFIX = 'fidc/federation-';
6
+
7
+ /**
8
+ * Create an empty idp export template
9
+ * @returns {AdminFederationExportInterface} an empty idp export template
10
+ */
11
+ function createAdminFederationExportTemplate() {
12
+ return {
13
+ meta: getMetadata(),
14
+ config: {},
15
+ idp: {}
16
+ };
17
+ }
18
+
19
+ /**
20
+ * Get all admin federation providers
21
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers
22
+ */
23
+ export async function getAdminFederationProviders() {
24
+ const {
25
+ result
26
+ } = await _getAdminFederationProviders();
27
+ return result;
28
+ }
29
+
30
+ /**
31
+ * Get admin federation provider by id
32
+ * @param {String} providerId social identity provider id/name
33
+ * @returns {Promise} a promise that resolves a social admin federation object
34
+ */
35
+ export async function getAdminFederationProvider(providerId) {
36
+ const response = await getAdminFederationProviders();
37
+ const foundProviders = response.filter(provider => provider._id === providerId);
38
+ switch (foundProviders.length) {
39
+ case 1:
40
+ return foundProviders[0];
41
+ case 0:
42
+ throw new Error(`Provider '${providerId}' not found`);
43
+ default:
44
+ throw new Error(`${foundProviders.length} providers '${providerId}' found`);
45
+ }
46
+ }
47
+ export async function putProviderByTypeAndId(providerType, providerId, providerData) {
48
+ debugMessage(`AdminFederationOps.putProviderByTypeAndId: start`);
49
+ try {
50
+ const response = await _putProviderByTypeAndId(providerType, providerId, providerData);
51
+ debugMessage(`AdminFederationOps.putProviderByTypeAndId: end`);
52
+ return response;
53
+ } catch (importError) {
54
+ var _importError$response, _importError$response2, _importError$response3;
55
+ if (((_importError$response = importError.response) === null || _importError$response === void 0 ? void 0 : _importError$response.status) === 400 && ((_importError$response2 = importError.response) === null || _importError$response2 === void 0 ? void 0 : (_importError$response3 = _importError$response2.data) === null || _importError$response3 === void 0 ? void 0 : _importError$response3.message) === 'Invalid attribute specified.') {
56
+ const {
57
+ validAttributes
58
+ } = importError.response.data.detail;
59
+ validAttributes.push('_id', '_type');
60
+ for (const attribute of Object.keys(providerData)) {
61
+ if (!validAttributes.includes(attribute)) {
62
+ debugMessage(`Removing invalid attribute: ${attribute}`);
63
+ delete providerData[attribute];
64
+ }
65
+ }
66
+ const response = await _putProviderByTypeAndId(providerType, providerId, providerData);
67
+ debugMessage(`AdminFederationOps.putProviderByTypeAndId: end (after retry)`);
68
+ return response;
69
+ } else {
70
+ // re-throw unhandleable error
71
+ throw importError;
72
+ }
73
+ }
74
+ }
75
+
76
+ /**
77
+ * Delete admin federation provider by id
78
+ * @param {String} providerId admin federation provider id/name
79
+ * @returns {Promise} a promise that resolves to an admin federation provider object
80
+ */
81
+ export async function deleteAdminFederationProvider(providerId) {
82
+ const response = await getAdminFederationProviders();
83
+ const foundProviders = response.filter(provider => provider._id === providerId);
84
+ switch (foundProviders.length) {
85
+ case 1:
86
+ return await deleteProviderByTypeAndId(foundProviders[0]._type._id, foundProviders[0]._id);
87
+ case 0:
88
+ throw new Error(`Provider '${providerId}' not found`);
89
+ default:
90
+ throw new Error(`${foundProviders.length} providers '${providerId}' found`);
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Export admin federation provider by id
96
+ * @param {string} providerId provider id/name
97
+ * @returns {Promise<AdminFederationExportInterface>} a promise that resolves to a SocialProviderExportInterface object
98
+ */
99
+ export async function exportAdminFederationProvider(providerId) {
100
+ debugMessage(`AdminFederationOps.exportAdminFederationProvider: start`);
101
+ const exportData = createAdminFederationExportTemplate();
102
+ const errors = [];
103
+ try {
104
+ const idpData = await getAdminFederationProvider(providerId);
105
+ exportData.idp[idpData._id] = idpData;
106
+ const idpConfig = await getConfigEntity(`${ADMIN_FED_CONFIG_ID_PREFIX}${providerId}`);
107
+ exportData.config[idpConfig._id] = idpConfig;
108
+ } catch (error) {
109
+ errors.push(error);
110
+ }
111
+ if (errors.length) {
112
+ const errorMessages = errors.map(error => error.message).join('\n');
113
+ throw new Error(`Export error:\n${errorMessages}`);
114
+ }
115
+ debugMessage(`AdminFederationOps.exportAdminFederationProvider: end`);
116
+ return exportData;
117
+ }
118
+
119
+ /**
120
+ * Export all providers
121
+ * @returns {Promise<AdminFederationExportInterface>} a promise that resolves to a SocialProviderExportInterface object
122
+ */
123
+ export async function exportAdminFederationProviders() {
124
+ debugMessage(`AdminFederationOps.exportAdminFederationProviders: start`);
125
+ const exportData = createAdminFederationExportTemplate();
126
+ const errors = [];
127
+ try {
128
+ const allIdpsData = await getAdminFederationProviders();
129
+ for (const idpData of allIdpsData) {
130
+ try {
131
+ exportData.idp[idpData._id] = idpData;
132
+ const idpConfig = await getConfigEntity(`${ADMIN_FED_CONFIG_ID_PREFIX}${idpData._id}`);
133
+ exportData.config[idpConfig._id] = idpConfig;
134
+ } catch (error) {
135
+ errors.push(error);
136
+ }
137
+ }
138
+ } catch (error) {
139
+ errors.push(error);
140
+ }
141
+ if (errors.length) {
142
+ const errorMessages = errors.map(error => error.message).join('\n');
143
+ throw new Error(`Export error:\n${errorMessages}`);
144
+ }
145
+ debugMessage(`AdminFederationOps.exportAdminFederationProviders: end`);
146
+ return exportData;
147
+ }
148
+
149
+ /**
150
+ * Import admin federation provider by id/name
151
+ * @param {string} providerId provider id/name
152
+ * @param {AdminFederationExportInterface} importData import data
153
+ */
154
+ export async function importAdminFederationProvider(providerId, importData) {
155
+ let response = null;
156
+ const errors = [];
157
+ const imported = [];
158
+ for (const idpId of Object.keys(importData.idp)) {
159
+ if (idpId === providerId) {
160
+ try {
161
+ response = await putProviderByTypeAndId(importData.idp[idpId]._type._id, idpId, importData.idp[idpId]);
162
+ const configId = `${ADMIN_FED_CONFIG_ID_PREFIX}${idpId}`;
163
+ if (importData.config[configId]) {
164
+ await putConfigEntity(configId, importData.config[configId]);
165
+ }
166
+ imported.push(idpId);
167
+ } catch (error) {
168
+ errors.push(error);
169
+ }
170
+ }
171
+ }
172
+ if (errors.length) {
173
+ const errorMessages = errors.map(error => error.message).join('\n');
174
+ throw new Error(`Import error:\n${errorMessages}`);
175
+ }
176
+ if (0 === imported.length) {
177
+ throw new Error(`Import error:\n${providerId} not found in import data!`);
178
+ }
179
+ return response;
180
+ }
181
+
182
+ /**
183
+ * Import first provider
184
+ * @param {AdminFederationExportInterface} importData import data
185
+ */
186
+ export async function importFirstAdminFederationProvider(importData) {
187
+ let response = null;
188
+ const errors = [];
189
+ const imported = [];
190
+ for (const idpId of Object.keys(importData.idp)) {
191
+ try {
192
+ response = await putProviderByTypeAndId(importData.idp[idpId]._type._id, idpId, importData.idp[idpId]);
193
+ const configId = `${ADMIN_FED_CONFIG_ID_PREFIX}${idpId}`;
194
+ if (importData.config[configId]) {
195
+ await putConfigEntity(configId, importData.config[configId]);
196
+ }
197
+ imported.push(idpId);
198
+ } catch (error) {
199
+ errors.push(error);
200
+ }
201
+ }
202
+ if (errors.length) {
203
+ const errorMessages = errors.map(error => error.message).join('\n');
204
+ throw new Error(`Import error:\n${errorMessages}`);
205
+ }
206
+ if (0 === imported.length) {
207
+ throw new Error(`Import error:\nNo providers found in import data!`);
208
+ }
209
+ return response;
210
+ }
211
+
212
+ /**
213
+ * Import all providers
214
+ * @param {AdminFederationExportInterface} importData import data
215
+ */
216
+ export async function importAdminFederationProviders(importData) {
217
+ const response = [];
218
+ const errors = [];
219
+ const imported = [];
220
+ for (const idpId of Object.keys(importData.idp)) {
221
+ try {
222
+ response.push(await putProviderByTypeAndId(importData.idp[idpId]._type._id, idpId, importData.idp[idpId]));
223
+ const configId = `${ADMIN_FED_CONFIG_ID_PREFIX}${idpId}`;
224
+ if (importData.config[configId]) {
225
+ await putConfigEntity(configId, importData.config[configId]);
226
+ }
227
+ imported.push(idpId);
228
+ } catch (error) {
229
+ errors.push(error);
230
+ }
231
+ }
232
+ if (errors.length) {
233
+ const errorMessages = errors.map(error => error.message).join('\n');
234
+ throw new Error(`Import error:\n${errorMessages}`);
235
+ }
236
+ if (0 === imported.length) {
237
+ throw new Error(`Import error:\nNo providers found in import data!`);
238
+ }
239
+ return response;
240
+ }
241
+ //# sourceMappingURL=AdminFederationOps.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rockcarver/frodo-lib",
3
- "version": "0.19.2",
3
+ "version": "1.0.1-0",
4
4
  "type": "commonjs",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.mjs",
@@ -16,6 +16,15 @@ export interface PagedResults {
16
16
  export interface UiConfigInterface {
17
17
  categories: string;
18
18
  }
19
+ export type AdminFederationConfigSkeleton = IdObjectSkeletonInterface & {
20
+ groups: {
21
+ claim: string;
22
+ mappings: {
23
+ 'super-admins': string[];
24
+ 'tenant-admins': string[];
25
+ };
26
+ };
27
+ };
19
28
  export interface NodeRefSkeletonInterface {
20
29
  connections: Record<string, string>;
21
30
  displayName: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/ApiTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,2BAA2B;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,EAAE,GACR,yBAAyB,GACzB,MAAM,GACN,IAAI,CAAC;CACV;AAED,MAAM,WAAW,yBAA0B,SAAQ,2BAA2B;IAC5E,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,YAAY;IAE3B,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,6BAA6B;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,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M,GAAG,uBAAuB,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC","file":"ApiTypes.d.ts","sourcesContent":["export interface NoIdObjectSkeletonInterface {\n _rev?: number;\n [k: string]:\n | string\n | number\n | boolean\n | string[]\n | IdObjectSkeletonInterface\n | object\n | null;\n}\n\nexport interface IdObjectSkeletonInterface extends NoIdObjectSkeletonInterface {\n _id: string;\n}\n\nexport interface PagedResults {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result: any[];\n resultCount: number;\n pagedResultsCookie: string;\n totalPagedResultsPolicy: string;\n totalPagedResults: number;\n remainingPagedResults: number;\n}\n\nexport interface UiConfigInterface {\n categories: string;\n}\n\nexport interface NodeRefSkeletonInterface {\n connections: Record<string, string>;\n displayName: string;\n nodeType: string;\n x: number;\n y: number;\n}\n\nexport interface InnerNodeRefSkeletonInterface {\n _id: string;\n displayName: string;\n nodeType: string;\n}\n\nexport type TreeSkeleton = IdObjectSkeletonInterface & {\n entryNodeId: string;\n nodes: Record<string, NodeRefSkeletonInterface>;\n identityResource?: string;\n uiConfig?: UiConfigInterface;\n enabled?: boolean;\n};\n\nexport type AmServiceType = IdObjectSkeletonInterface & {\n name: string;\n};\n\nexport type NodeSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n nodes?: InnerNodeRefSkeletonInterface[];\n tree?: string;\n identityResource?: string;\n};\n\nexport type SocialIdpSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n enabled: boolean;\n};\n\nexport type PolicySetSkeleton = NoIdObjectSkeletonInterface & {\n name: string;\n resourceTypeUuids: string[];\n};\n\nexport type ResourceTypeSkeleton = NoIdObjectSkeletonInterface & {\n uuid: string;\n name: string;\n};\n\nexport enum PolicyConditionType {\n Script = 'Script',\n AMIdentityMembership = 'AMIdentityMembership',\n IPv6 = 'IPv6',\n IPv4 = 'IPv4',\n SimpleTime = 'SimpleTime',\n LEAuthLevel = 'LEAuthLevel',\n LDAPFilter = 'LDAPFilter',\n AuthScheme = 'AuthScheme',\n Session = 'Session',\n AND = 'AND',\n AuthenticateToRealm = 'AuthenticateToRealm',\n ResourceEnvIP = 'ResourceEnvIP',\n Policy = 'Policy',\n OAuth2Scope = 'OAuth2Scope',\n SessionProperty = 'SessionProperty',\n OR = 'OR',\n Transaction = 'Transaction',\n NOT = 'NOT',\n AuthLevel = 'AuthLevel',\n AuthenticateToService = 'AuthenticateToService',\n}\n\nexport type PolicyCondition = NoIdObjectSkeletonInterface & {\n type: keyof typeof PolicyConditionType;\n condition?: PolicyCondition;\n conditions?: PolicyCondition[];\n};\n\nexport type PolicySkeleton = IdObjectSkeletonInterface & {\n name: string;\n applicationName: string;\n condition?: PolicyCondition;\n resourceTypeUuid: string;\n};\n\nexport type OAuth2ClientSkeleton = IdObjectSkeletonInterface & {\n overrideOAuth2ClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n advancedOAuth2ClientConfig?: {\n descriptions: {\n inherited: boolean;\n value: string[];\n };\n [k: string]: string | number | boolean | string[] | object | null;\n };\n signEncOAuth2ClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreOpenIDClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreOAuth2ClientConfig?: {\n userpassword?: null;\n clientName?: {\n inherited: boolean;\n value: string[];\n };\n accessTokenLifetime?: {\n inherited: boolean;\n value: number;\n };\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreUmaClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n _type: AmServiceType;\n};\n\nexport type AmServiceSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n};\n\nexport type AgentSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n};\n\nexport type EmailTemplateSkeleton = IdObjectSkeletonInterface & {\n defaultLocale?: string;\n displayName?: string;\n enabled?: boolean;\n from: string;\n subject: Record<string, string>;\n message?: Record<string, string>;\n html?: Record<string, string>;\n};\n\nexport type ThemeSkeleton = IdObjectSkeletonInterface & {\n name: string;\n isDefault: boolean;\n linkedTrees: string[];\n};\n\nexport type UiThemeRealmObject = IdObjectSkeletonInterface & {\n name: string;\n realm: Map<string, ThemeSkeleton[]>;\n};\n\nexport enum ScriptLanguage {\n GROOVY,\n JAVASCRIPT,\n}\n\nexport enum ScriptContext {\n OAUTH2_ACCESS_TOKEN_MODIFICATION,\n AUTHENTICATION_CLIENT_SIDE,\n AUTHENTICATION_TREE_DECISION_NODE,\n AUTHENTICATION_SERVER_SIDE,\n SOCIAL_IDP_PROFILE_TRANSFORMATION,\n OAUTH2_VALIDATE_SCOPE,\n CONFIG_PROVIDER_NODE,\n OAUTH2_AUTHORIZE_ENDPOINT_DATA_PROVIDER,\n OAUTH2_EVALUATE_SCOPE,\n POLICY_CONDITION,\n OIDC_CLAIMS,\n SAML2_IDP_ADAPTER,\n SAML2_IDP_ATTRIBUTE_MAPPER,\n OAUTH2_MAY_ACT,\n}\n\nexport type ScriptSkeleton = IdObjectSkeletonInterface & {\n name: string;\n description: string;\n default: boolean;\n script: string | string[];\n language: keyof typeof ScriptLanguage;\n context: keyof typeof ScriptContext;\n createdBy: string;\n creationDate: number;\n lastModifiedBy: string;\n lastModifiedDate: number;\n};\n\nexport enum Saml2ProiderLocation {\n HOSTED = 'hosted',\n REMOTE = 'remote',\n}\n\nexport type Saml2ProviderStub = IdObjectSkeletonInterface & {\n entityId: string;\n location: Saml2ProiderLocation;\n roles: string[];\n};\n\nexport type Saml2ProviderSkeleton = IdObjectSkeletonInterface & {\n entityId: string;\n entityLocation: Saml2ProiderLocation;\n serviceProvider: unknown;\n identityProvider: unknown;\n attributeQueryProvider: unknown;\n xacmlPolicyEnforcementPoint: unknown;\n};\n\nexport type CircleOfTrustSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n status: string;\n trustedProviders: string[];\n};\n\nexport type PagedResult<Result> = {\n result: Result[];\n resultCount: number;\n pagedResultsCookie: string;\n totalPagedResultsPolicy: 'EXACT';\n totalPagedResults: number;\n remainingPagedResults: number;\n};\n\nexport type LogApiKey = {\n name: string;\n api_key_id: string;\n created_at: string;\n};\n\nexport type LogEventPayloadSkeleton = NoIdObjectSkeletonInterface & {\n context: string;\n level: string;\n logger: string;\n mdc: {\n transactionId: string;\n };\n message: string;\n thread: string;\n timestamp: string;\n transactionId: string;\n};\n\nexport type LogEventSkeleton = NoIdObjectSkeletonInterface & {\n payload: string | LogEventPayloadSkeleton;\n timestamp: string;\n type: string;\n source: string;\n};\n"]}
1
+ {"version":3,"sources":["../src/api/ApiTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,2BAA2B;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,EAAE,GACR,yBAAyB,GACzB,MAAM,GACN,IAAI,CAAC;CACV;AAED,MAAM,WAAW,yBAA0B,SAAQ,2BAA2B;IAC5E,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,YAAY;IAE3B,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,6BAA6B,GAAG,yBAAyB,GAAG;IACtE,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE;YACR,cAAc,EAAE,MAAM,EAAE,CAAC;YACzB,eAAe,EAAE,MAAM,EAAE,CAAC;SAC3B,CAAC;KACH,CAA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O,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE;QACH,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,2BAA2B,GAAG;IAC3D,OAAO,EAAE,MAAM,GAAG,uBAAuB,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC","file":"ApiTypes.d.ts","sourcesContent":["export interface NoIdObjectSkeletonInterface {\n _rev?: number;\n [k: string]:\n | string\n | number\n | boolean\n | string[]\n | IdObjectSkeletonInterface\n | object\n | null;\n}\n\nexport interface IdObjectSkeletonInterface extends NoIdObjectSkeletonInterface {\n _id: string;\n}\n\nexport interface PagedResults {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result: any[];\n resultCount: number;\n pagedResultsCookie: string;\n totalPagedResultsPolicy: string;\n totalPagedResults: number;\n remainingPagedResults: number;\n}\n\nexport interface UiConfigInterface {\n categories: string;\n}\n\nexport type AdminFederationConfigSkeleton = IdObjectSkeletonInterface & {\n groups: {\n claim: string;\n mappings: {\n 'super-admins': string[];\n 'tenant-admins': string[];\n };\n };\n};\n\nexport interface NodeRefSkeletonInterface {\n connections: Record<string, string>;\n displayName: string;\n nodeType: string;\n x: number;\n y: number;\n}\n\nexport interface InnerNodeRefSkeletonInterface {\n _id: string;\n displayName: string;\n nodeType: string;\n}\n\nexport type TreeSkeleton = IdObjectSkeletonInterface & {\n entryNodeId: string;\n nodes: Record<string, NodeRefSkeletonInterface>;\n identityResource?: string;\n uiConfig?: UiConfigInterface;\n enabled?: boolean;\n};\n\nexport type AmServiceType = IdObjectSkeletonInterface & {\n name: string;\n};\n\nexport type NodeSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n nodes?: InnerNodeRefSkeletonInterface[];\n tree?: string;\n identityResource?: string;\n};\n\nexport type SocialIdpSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n enabled: boolean;\n};\n\nexport type PolicySetSkeleton = NoIdObjectSkeletonInterface & {\n name: string;\n resourceTypeUuids: string[];\n};\n\nexport type ResourceTypeSkeleton = NoIdObjectSkeletonInterface & {\n uuid: string;\n name: string;\n};\n\nexport enum PolicyConditionType {\n Script = 'Script',\n AMIdentityMembership = 'AMIdentityMembership',\n IPv6 = 'IPv6',\n IPv4 = 'IPv4',\n SimpleTime = 'SimpleTime',\n LEAuthLevel = 'LEAuthLevel',\n LDAPFilter = 'LDAPFilter',\n AuthScheme = 'AuthScheme',\n Session = 'Session',\n AND = 'AND',\n AuthenticateToRealm = 'AuthenticateToRealm',\n ResourceEnvIP = 'ResourceEnvIP',\n Policy = 'Policy',\n OAuth2Scope = 'OAuth2Scope',\n SessionProperty = 'SessionProperty',\n OR = 'OR',\n Transaction = 'Transaction',\n NOT = 'NOT',\n AuthLevel = 'AuthLevel',\n AuthenticateToService = 'AuthenticateToService',\n}\n\nexport type PolicyCondition = NoIdObjectSkeletonInterface & {\n type: keyof typeof PolicyConditionType;\n condition?: PolicyCondition;\n conditions?: PolicyCondition[];\n};\n\nexport type PolicySkeleton = IdObjectSkeletonInterface & {\n name: string;\n applicationName: string;\n condition?: PolicyCondition;\n resourceTypeUuid: string;\n};\n\nexport type OAuth2ClientSkeleton = IdObjectSkeletonInterface & {\n overrideOAuth2ClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n advancedOAuth2ClientConfig?: {\n descriptions: {\n inherited: boolean;\n value: string[];\n };\n [k: string]: string | number | boolean | string[] | object | null;\n };\n signEncOAuth2ClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreOpenIDClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreOAuth2ClientConfig?: {\n userpassword?: null;\n clientName?: {\n inherited: boolean;\n value: string[];\n };\n accessTokenLifetime?: {\n inherited: boolean;\n value: number;\n };\n [k: string]: string | number | boolean | string[] | object | null;\n };\n coreUmaClientConfig?: {\n [k: string]: string | number | boolean | string[] | object | null;\n };\n _type: AmServiceType;\n};\n\nexport type AmServiceSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n};\n\nexport type AgentSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n};\n\nexport type EmailTemplateSkeleton = IdObjectSkeletonInterface & {\n defaultLocale?: string;\n displayName?: string;\n enabled?: boolean;\n from: string;\n subject: Record<string, string>;\n message?: Record<string, string>;\n html?: Record<string, string>;\n};\n\nexport type ThemeSkeleton = IdObjectSkeletonInterface & {\n name: string;\n isDefault: boolean;\n linkedTrees: string[];\n};\n\nexport type UiThemeRealmObject = IdObjectSkeletonInterface & {\n name: string;\n realm: Map<string, ThemeSkeleton[]>;\n};\n\nexport enum ScriptLanguage {\n GROOVY,\n JAVASCRIPT,\n}\n\nexport enum ScriptContext {\n OAUTH2_ACCESS_TOKEN_MODIFICATION,\n AUTHENTICATION_CLIENT_SIDE,\n AUTHENTICATION_TREE_DECISION_NODE,\n AUTHENTICATION_SERVER_SIDE,\n SOCIAL_IDP_PROFILE_TRANSFORMATION,\n OAUTH2_VALIDATE_SCOPE,\n CONFIG_PROVIDER_NODE,\n OAUTH2_AUTHORIZE_ENDPOINT_DATA_PROVIDER,\n OAUTH2_EVALUATE_SCOPE,\n POLICY_CONDITION,\n OIDC_CLAIMS,\n SAML2_IDP_ADAPTER,\n SAML2_IDP_ATTRIBUTE_MAPPER,\n OAUTH2_MAY_ACT,\n}\n\nexport type ScriptSkeleton = IdObjectSkeletonInterface & {\n name: string;\n description: string;\n default: boolean;\n script: string | string[];\n language: keyof typeof ScriptLanguage;\n context: keyof typeof ScriptContext;\n createdBy: string;\n creationDate: number;\n lastModifiedBy: string;\n lastModifiedDate: number;\n};\n\nexport enum Saml2ProiderLocation {\n HOSTED = 'hosted',\n REMOTE = 'remote',\n}\n\nexport type Saml2ProviderStub = IdObjectSkeletonInterface & {\n entityId: string;\n location: Saml2ProiderLocation;\n roles: string[];\n};\n\nexport type Saml2ProviderSkeleton = IdObjectSkeletonInterface & {\n entityId: string;\n entityLocation: Saml2ProiderLocation;\n serviceProvider: unknown;\n identityProvider: unknown;\n attributeQueryProvider: unknown;\n xacmlPolicyEnforcementPoint: unknown;\n};\n\nexport type CircleOfTrustSkeleton = IdObjectSkeletonInterface & {\n _type: AmServiceType;\n status: string;\n trustedProviders: string[];\n};\n\nexport type PagedResult<Result> = {\n result: Result[];\n resultCount: number;\n pagedResultsCookie: string;\n totalPagedResultsPolicy: 'EXACT';\n totalPagedResults: number;\n remainingPagedResults: number;\n};\n\nexport type LogApiKey = {\n name: string;\n api_key_id: string;\n created_at: string;\n};\n\nexport type LogEventPayloadSkeleton = NoIdObjectSkeletonInterface & {\n context: string;\n level: string;\n logger: string;\n mdc: {\n transactionId: string;\n };\n message: string;\n thread: string;\n timestamp: string;\n transactionId: string;\n};\n\nexport type LogEventSkeleton = NoIdObjectSkeletonInterface & {\n payload: string | LogEventPayloadSkeleton;\n timestamp: string;\n type: string;\n source: string;\n};\n"]}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Get admin federation provider types
3
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation provider types
4
+ */
5
+ export declare function getAdminFederationProviderTypes(): Promise<any>;
6
+ /**
7
+ * Get admin federation providers by type
8
+ * @param {String} type admin federation provider type
9
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers of the requested type
10
+ */
11
+ export declare function getAdminFederationProvidersByType(type: any): Promise<any>;
12
+ /**
13
+ * Get all admin federation providers
14
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers
15
+ */
16
+ export declare function getAdminFederationProviders(): Promise<any>;
17
+ /**
18
+ * Get admin federation provider by type and id
19
+ * @param {*} type admin federation provider type
20
+ * @param {*} id admin federation provider id/name
21
+ * @returns {Promise} a promise that resolves to an object containing a admin federation provider
22
+ */
23
+ export declare function getProviderByTypeAndId(type: any, id: any): Promise<any>;
24
+ /**
25
+ * Get admin federation provider by type and id
26
+ * @param {String} type admin federation provider type
27
+ * @param {String} id admin federation provider id/name
28
+ * @param {Object} providerData a admin federation provider object
29
+ * @returns {Promise} a promise that resolves to an object containing a admin federation provider
30
+ */
31
+ export declare function putProviderByTypeAndId(type: any, id: any, providerData: any): Promise<any>;
32
+ /**
33
+ * Delete admin federation provider by type and id
34
+ * @param {string} providerId provider type
35
+ * @param {string} providerId provider id
36
+ * @returns {Promise<unknown>} a promise that resolves to a admin federation provider
37
+ */
38
+ export declare function deleteProviderByTypeAndId(type: string, providerId: string): Promise<any>;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/api/cloud/AdminFederationProvidersApi.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,wBAAsB,+BAA+B,iBAUpD;AAED;;;;GAIG;AACH,wBAAsB,iCAAiC,CAAC,IAAI,KAAA,gBAW3D;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,iBAchD;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,KAAA,EAAE,EAAE,KAAA,gBAYpD;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,KAAA,EAAE,EAAE,KAAA,EAAE,YAAY,KAAA,gBAmBlE;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,gBAanB","file":"AdminFederationProvidersApi.d.ts","sourcesContent":["import util from 'util';\nimport { generateAmApi } from '../BaseApi';\nimport { deleteDeepByKey, getRealmPath } from '../utils/ApiUtils';\nimport * as state from '../../shared/State';\n\nconst getAllProviderTypesURLTemplate =\n '%s/json%s/realm-config/services/SocialIdentityProviders?_action=getAllTypes';\nconst providerByTypeAndIdURLTemplate =\n '%s/json%s/realm-config/services/SocialIdentityProviders/%s/%s';\nconst getAllProvidersURLTemplate =\n '%s/json%s/realm-config/services/SocialIdentityProviders?_action=nextdescendents';\nconst getProvidersByTypeURLTemplate =\n '%s/json%s/realm-config/services/SocialIdentityProviders/%s?_queryFilter=true';\nconst apiVersion = 'protocol=2.1,resource=1.0';\nconst getApiConfig = () => {\n const configPath = getRealmPath('/');\n return {\n path: `${configPath}/realm-config/services/SocialIdentityProviders`,\n apiVersion,\n };\n};\n\n/**\n * Get admin federation provider types\n * @returns {Promise} a promise that resolves to an object containing an array of admin federation provider types\n */\nexport async function getAdminFederationProviderTypes() {\n const urlString = util.format(\n getAllProviderTypesURLTemplate,\n state.getHost(),\n getRealmPath('/')\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get admin federation providers by type\n * @param {String} type admin federation provider type\n * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers of the requested type\n */\nexport async function getAdminFederationProvidersByType(type) {\n const urlString = util.format(\n getProvidersByTypeURLTemplate,\n state.getHost(),\n getRealmPath('/'),\n type\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get all admin federation providers\n * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers\n */\nexport async function getAdminFederationProviders() {\n const urlString = util.format(\n getAllProvidersURLTemplate,\n state.getHost(),\n getRealmPath('/')\n );\n const { data } = await generateAmApi(getApiConfig()).post(\n urlString,\n {},\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Get admin federation provider by type and id\n * @param {*} type admin federation provider type\n * @param {*} id admin federation provider id/name\n * @returns {Promise} a promise that resolves to an object containing a admin federation provider\n */\nexport async function getProviderByTypeAndId(type, id) {\n const urlString = util.format(\n providerByTypeAndIdURLTemplate,\n state.getHost(),\n getRealmPath('/'),\n type,\n id\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get admin federation provider by type and id\n * @param {String} type admin federation provider type\n * @param {String} id admin federation provider id/name\n * @param {Object} providerData a admin federation provider object\n * @returns {Promise} a promise that resolves to an object containing a admin federation provider\n */\nexport async function putProviderByTypeAndId(type, id, providerData) {\n // until we figure out a way to use transport keys in Frodo,\n // we'll have to drop those encrypted attributes.\n const cleanData = deleteDeepByKey(providerData, '-encrypted');\n const urlString = util.format(\n providerByTypeAndIdURLTemplate,\n state.getHost(),\n getRealmPath('/'),\n type,\n id\n );\n const { data } = await generateAmApi(getApiConfig()).put(\n urlString,\n cleanData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Delete admin federation provider by type and id\n * @param {string} providerId provider type\n * @param {string} providerId provider id\n * @returns {Promise<unknown>} a promise that resolves to a admin federation provider\n */\nexport async function deleteProviderByTypeAndId(\n type: string,\n providerId: string\n) {\n const urlString = util.format(\n providerByTypeAndIdURLTemplate,\n state.getHost(),\n getRealmPath('/'),\n type,\n providerId\n );\n const { data } = await generateAmApi(getApiConfig()).delete(urlString, {\n withCredentials: true,\n });\n return data;\n}\n"]}
package/types/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * as TypesRaw from './api/ApiTypes';
10
10
  export * as VariablesRaw from './api/cloud/VariablesApi';
11
11
  export * as IdmConfigRaw from './api/IdmConfigApi';
12
12
  export * as Admin from './ops/AdminOps';
13
+ export * as AdminFederation from './ops/cloud/AdminFederationOps';
13
14
  export * as Agent from './ops/AgentOps';
14
15
  export * as Authenticate from './ops/AuthenticateOps';
15
16
  export * as CirclesOfTrust from './ops/CirclesOfTrustOps';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,eAAe,MAAM,uBAAuB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,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AAGnE,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC","file":"index.d.ts","sourcesContent":["import Color from 'colors';\n\nColor.enable();\n\n// Api Layer\nexport * as AgentRaw from './api/AgentApi';\nexport * as AuthenticateRaw from './api/AuthenticateApi';\nexport * as NodeRaw from './api/NodeApi';\n// TODO: need to figure out if this is the right approach or if we should even\n// use a public oauth2/oidc library. might be ok for now since there is only\n// one place where the cli needs to execute an oauth flow.\nexport * as OAuth2OIDCApi from './api/OAuth2OIDCApi';\nexport * as SecretsRaw from './api/cloud/SecretsApi';\nexport * as SocialIdentityProvidersRaw from './api/SocialIdentityProvidersApi';\nexport * as StartupRaw from './api/cloud/StartupApi';\nexport * as TreeRaw from './api/TreeApi';\nexport * as TypesRaw from './api/ApiTypes';\nexport * as VariablesRaw from './api/cloud/VariablesApi';\nexport * as IdmConfigRaw from './api/IdmConfigApi';\n\n// Ops Layer\nexport * as Admin from './ops/AdminOps';\nexport * as Agent from './ops/AgentOps';\nexport * as Authenticate from './ops/AuthenticateOps';\nexport * as CirclesOfTrust from './ops/CirclesOfTrustOps';\nexport * as ConnectionProfile from './ops/ConnectionProfileOps';\nexport * as EmailTemplate from './ops/EmailTemplateOps';\nexport * as Idp from './ops/IdpOps';\nexport * as Idm from './ops/IdmOps';\nexport * as Info from './ops/InfoOps';\nexport * as Journey from './ops/JourneyOps';\nexport * as Jose from './ops/JoseOps';\nexport * as Log from './ops/cloud/LogOps';\nexport * as ManagedObject from './ops/ManagedObjectOps';\nexport * as Node from './ops/NodeOps';\nexport * as OAuth2Client from './ops/OAuth2ClientOps';\nexport * as OAuth2Provider from './ops/OAuth2ProviderOps';\nexport * as Organization from './ops/OrganizationOps';\nexport * as Policy from './ops/PolicyOps';\nexport * as PolicySet from './ops/PolicySetOps';\nexport * as Realm from './ops/RealmOps';\nexport * as ResourceType from './ops/ResourceTypeOps';\nexport * as Saml2 from './ops/Saml2Ops';\nexport * as Script from './ops/ScriptOps';\nexport * as Service from './ops/ServiceOps';\nexport * as Secrets from './ops/cloud/SecretsOps';\nexport * as ServiceAccount from './ops/cloud/ServiceAccountOps';\nexport * as Startup from './ops/cloud/StartupOps';\nexport * as Theme from './ops/ThemeOps';\nexport * as Types from './ops/OpsTypes';\nexport * as Variables from './ops/cloud/VariablesOps';\n// TODO: revisit if there are better ways\nexport * as Utils from './ops/utils/OpsUtils';\nexport * as Base64 from './api/utils/Base64';\nexport * as ValidationUtils from './ops/utils/ValidationUtils';\nexport * as LibVersion from './ops/utils/Version';\nexport * as ExportImportUtils from './ops/utils/ExportImportUtils';\n// TODO: reconsider the aproach to pass in state from client\n// lib should be stateless, an aplication should own its state\nexport * as state from './shared/State';\nexport * as constants from './storage/StaticStorage';\n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M,uBAAuB,CAAC;AACtD,OAAO,KAAK,cAAc,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,cAAc,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAC;AAGnE,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC","file":"index.d.ts","sourcesContent":["import Color from 'colors';\n\nColor.enable();\n\n// Api Layer\nexport * as AgentRaw from './api/AgentApi';\nexport * as AuthenticateRaw from './api/AuthenticateApi';\nexport * as NodeRaw from './api/NodeApi';\n// TODO: need to figure out if this is the right approach or if we should even\n// use a public oauth2/oidc library. might be ok for now since there is only\n// one place where the cli needs to execute an oauth flow.\nexport * as OAuth2OIDCApi from './api/OAuth2OIDCApi';\nexport * as SecretsRaw from './api/cloud/SecretsApi';\nexport * as SocialIdentityProvidersRaw from './api/SocialIdentityProvidersApi';\nexport * as StartupRaw from './api/cloud/StartupApi';\nexport * as TreeRaw from './api/TreeApi';\nexport * as TypesRaw from './api/ApiTypes';\nexport * as VariablesRaw from './api/cloud/VariablesApi';\nexport * as IdmConfigRaw from './api/IdmConfigApi';\n\n// Ops Layer\nexport * as Admin from './ops/AdminOps';\nexport * as AdminFederation from './ops/cloud/AdminFederationOps';\nexport * as Agent from './ops/AgentOps';\nexport * as Authenticate from './ops/AuthenticateOps';\nexport * as CirclesOfTrust from './ops/CirclesOfTrustOps';\nexport * as ConnectionProfile from './ops/ConnectionProfileOps';\nexport * as EmailTemplate from './ops/EmailTemplateOps';\nexport * as Idp from './ops/IdpOps';\nexport * as Idm from './ops/IdmOps';\nexport * as Info from './ops/InfoOps';\nexport * as Journey from './ops/JourneyOps';\nexport * as Jose from './ops/JoseOps';\nexport * as Log from './ops/cloud/LogOps';\nexport * as ManagedObject from './ops/ManagedObjectOps';\nexport * as Node from './ops/NodeOps';\nexport * as OAuth2Client from './ops/OAuth2ClientOps';\nexport * as OAuth2Provider from './ops/OAuth2ProviderOps';\nexport * as Organization from './ops/OrganizationOps';\nexport * as Policy from './ops/PolicyOps';\nexport * as PolicySet from './ops/PolicySetOps';\nexport * as Realm from './ops/RealmOps';\nexport * as ResourceType from './ops/ResourceTypeOps';\nexport * as Saml2 from './ops/Saml2Ops';\nexport * as Script from './ops/ScriptOps';\nexport * as Service from './ops/ServiceOps';\nexport * as Secrets from './ops/cloud/SecretsOps';\nexport * as ServiceAccount from './ops/cloud/ServiceAccountOps';\nexport * as Startup from './ops/cloud/StartupOps';\nexport * as Theme from './ops/ThemeOps';\nexport * as Types from './ops/OpsTypes';\nexport * as Variables from './ops/cloud/VariablesOps';\n// TODO: revisit if there are better ways\nexport * as Utils from './ops/utils/OpsUtils';\nexport * as Base64 from './api/utils/Base64';\nexport * as ValidationUtils from './ops/utils/ValidationUtils';\nexport * as LibVersion from './ops/utils/Version';\nexport * as ExportImportUtils from './ops/utils/ExportImportUtils';\n// TODO: reconsider the aproach to pass in state from client\n// lib should be stateless, an aplication should own its state\nexport * as state from './shared/State';\nexport * as constants from './storage/StaticStorage';\n"]}
@@ -0,0 +1,52 @@
1
+ import { ExportMetaData } from '../OpsTypes';
2
+ import { AdminFederationConfigSkeleton, SocialIdpSkeleton } from '../../api/ApiTypes';
3
+ export interface AdminFederationExportInterface {
4
+ meta?: ExportMetaData;
5
+ config: Record<string, AdminFederationConfigSkeleton>;
6
+ idp: Record<string, SocialIdpSkeleton>;
7
+ }
8
+ /**
9
+ * Get all admin federation providers
10
+ * @returns {Promise} a promise that resolves to an object containing an array of admin federation providers
11
+ */
12
+ export declare function getAdminFederationProviders(): Promise<any>;
13
+ /**
14
+ * Get admin federation provider by id
15
+ * @param {String} providerId social identity provider id/name
16
+ * @returns {Promise} a promise that resolves a social admin federation object
17
+ */
18
+ export declare function getAdminFederationProvider(providerId: any): Promise<any>;
19
+ export declare function putProviderByTypeAndId(providerType: string, providerId: string, providerData: object): Promise<any>;
20
+ /**
21
+ * Delete admin federation provider by id
22
+ * @param {String} providerId admin federation provider id/name
23
+ * @returns {Promise} a promise that resolves to an admin federation provider object
24
+ */
25
+ export declare function deleteAdminFederationProvider(providerId: string): Promise<unknown>;
26
+ /**
27
+ * Export admin federation provider by id
28
+ * @param {string} providerId provider id/name
29
+ * @returns {Promise<AdminFederationExportInterface>} a promise that resolves to a SocialProviderExportInterface object
30
+ */
31
+ export declare function exportAdminFederationProvider(providerId: string): Promise<AdminFederationExportInterface>;
32
+ /**
33
+ * Export all providers
34
+ * @returns {Promise<AdminFederationExportInterface>} a promise that resolves to a SocialProviderExportInterface object
35
+ */
36
+ export declare function exportAdminFederationProviders(): Promise<AdminFederationExportInterface>;
37
+ /**
38
+ * Import admin federation provider by id/name
39
+ * @param {string} providerId provider id/name
40
+ * @param {AdminFederationExportInterface} importData import data
41
+ */
42
+ export declare function importAdminFederationProvider(providerId: string, importData: AdminFederationExportInterface): Promise<SocialIdpSkeleton>;
43
+ /**
44
+ * Import first provider
45
+ * @param {AdminFederationExportInterface} importData import data
46
+ */
47
+ export declare function importFirstAdminFederationProvider(importData: AdminFederationExportInterface): Promise<SocialIdpSkeleton>;
48
+ /**
49
+ * Import all providers
50
+ * @param {AdminFederationExportInterface} importData import data
51
+ */
52
+ export declare function importAdminFederationProviders(importData: AdminFederationExportInterface): Promise<SocialIdpSkeleton[]>;