@rockcarver/frodo-lib 0.12.5 → 0.12.7
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/CHANGELOG.md +32 -8
- package/cjs/api/ApiTypes.js +42 -0
- package/cjs/api/ApiTypes.js.map +1 -0
- package/cjs/api/Saml2Api.js +1 -1
- package/cjs/api/Saml2Api.js.map +1 -1
- package/cjs/index.js +17 -1
- package/cjs/index.js.map +1 -1
- package/cjs/ops/JourneyOps.js +282 -151
- package/cjs/ops/JourneyOps.js.map +1 -1
- package/cjs/ops/NodeOps.js +31 -15
- package/cjs/ops/NodeOps.js.map +1 -1
- package/cjs/ops/OpsTypes.js +34 -0
- package/cjs/ops/OpsTypes.js.map +1 -0
- package/cjs/ops/Saml2Ops.js +3 -0
- package/cjs/ops/Saml2Ops.js.map +1 -1
- package/cjs/ops/utils/Console.js +18 -1
- package/cjs/ops/utils/Console.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.js.map +1 -1
- package/cjs/storage/SessionStorage.js +4 -0
- package/cjs/storage/SessionStorage.js.map +1 -1
- package/esm/api/ApiTypes.mjs +33 -0
- package/esm/api/Saml2Api.mjs +1 -1
- package/esm/index.mjs +5 -0
- package/esm/ops/JourneyOps.mjs +208 -119
- package/esm/ops/NodeOps.mjs +28 -15
- package/esm/ops/OpsTypes.mjs +25 -0
- package/esm/ops/Saml2Ops.mjs +1 -1
- package/esm/ops/utils/Console.mjs +16 -1
- package/esm/storage/SessionStorage.mjs +4 -0
- package/package.json +3 -2
- package/types/api/ApiTypes.d.ts +102 -0
- package/types/api/ApiTypes.d.ts.map +1 -0
- package/types/api/Saml2Api.d.ts +1 -1
- package/types/api/Saml2Api.d.ts.map +1 -1
- package/types/index.d.ts +3 -0
- package/types/index.d.ts.map +1 -1
- package/types/ops/JourneyOps.d.ts +83 -87
- package/types/ops/JourneyOps.d.ts.map +1 -1
- package/types/ops/NodeOps.d.ts +10 -0
- package/types/ops/NodeOps.d.ts.map +1 -1
- package/types/ops/OpsTypes.d.ts +78 -0
- package/types/ops/OpsTypes.d.ts.map +1 -0
- package/types/ops/Saml2Ops.d.ts +6 -0
- package/types/ops/Saml2Ops.d.ts.map +1 -1
- package/types/ops/utils/Console.d.ts +9 -1
- package/types/ops/utils/Console.d.ts.map +1 -1
- package/types/ops/utils/ExportImportUtils.d.ts.map +1 -1
- package/types/storage/SessionStorage.d.ts +4 -0
- package/types/storage/SessionStorage.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,8 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.12.7] - 2022-10-02
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- \#107: Frodo now sets identityResource on import when the target is ID Cloud or ForgeOps but the import file was exported from a classic deployment
|
|
15
|
+
- Better journey import resiliency by handling `400 - invalid attribute` errors and retrying without the attributes. This is necessary to import journeys exported from a different version requiring different configuration options. Use the `--verbose` parameter to see when invalid attributes are being removed on import.
|
|
16
|
+
|
|
17
|
+
## [0.12.6] - 2022-09-30
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- \#104: Enhanced `frodo journey describe` command to include more details
|
|
22
|
+
|
|
10
23
|
## [0.12.5] - 2022-09-29
|
|
11
24
|
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- \#98: Frodo now properly runs `frodo idm export -A -D ./idm <host>` command
|
|
28
|
+
- \#100: Frodo now properly handles nested realms when specified as `/parent/child`
|
|
29
|
+
- \#101: Frodo now properly sets the identity resource when the realm was specified with a leading slash
|
|
30
|
+
- \#102: Frodo now properly replaces existing themes on import when the realm was specified with a leading slash
|
|
31
|
+
|
|
12
32
|
## [0.12.5-0] - 2022-09-19
|
|
13
33
|
|
|
14
34
|
## [0.12.4] - 2022-09-17
|
|
@@ -17,9 +37,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
17
37
|
|
|
18
38
|
- Frodo now allows two new parameters when adding a connection profile:
|
|
19
39
|
|
|
20
|
-
\--authentication-service [service]
|
|
40
|
+
\--authentication-service [service] Name of the authentication service/tree to use.
|
|
21
41
|
|
|
22
|
-
\--authentication-header-overrides [headers]
|
|
42
|
+
\--authentication-header-overrides [headers] Map of headers: {"host":"am.example.com:8081"}.
|
|
23
43
|
|
|
24
44
|
These parameters are currently only supported in the `frodo conn add` command and the configuration elements will be automatically applied to commands issued using that connection profile.
|
|
25
45
|
|
|
@@ -29,13 +49,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
29
49
|
Saving creds in /Users/vscheuber/.frodo/.frodorc...
|
|
30
50
|
Updating connection profile https://platform.example.com:9443/am
|
|
31
51
|
Advanced setting: Authentication Service: ldapService
|
|
32
|
-
Advanced setting: Authentication Header Overrides:
|
|
52
|
+
Advanced setting: Authentication Header Overrides:
|
|
33
53
|
{ host: 'am.example.com:8081' }
|
|
34
54
|
%
|
|
35
55
|
|
|
36
56
|
After the connection profile is created with the additional parameters, the environment can be accessed as usual. In this case it requires the `-k` parameter for every command, as the environment uses a self-signed certificate.
|
|
37
57
|
|
|
38
|
-
% frodo journey list platform alpha -k
|
|
58
|
+
% frodo journey list platform alpha -k
|
|
39
59
|
ForgeOps deployment detected.
|
|
40
60
|
Connected to ForgeRock Access Management 7.2.0 Build 64ef7ebc01ed3df1a1264d7b0400351bc101361f (2022-June-27 08:15)
|
|
41
61
|
Listing journeys in realm "alpha"...
|
|
@@ -127,7 +147,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
127
147
|
|
|
128
148
|
### Changed
|
|
129
149
|
|
|
130
|
-
- \#19: `frodo-lib` is now a typescript project.
|
|
150
|
+
- \#19: `frodo-lib` is now a typescript project.
|
|
131
151
|
|
|
132
152
|
## [0.11.1-7] - 2022-08-21
|
|
133
153
|
|
|
@@ -326,9 +346,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
326
346
|
|
|
327
347
|
- Changed `idm` sub-commands to align with other commands:
|
|
328
348
|
- The sub-commands `export`, `exportAll`, and `exportAllRaw` have been collapsed into one: `export`
|
|
329
|
-
- `idm export -A` (`--all-separate`) is now the way to export all idm configuration.
|
|
349
|
+
- `idm export -A` (`--all-separate`) is now the way to export all idm configuration.
|
|
330
350
|
- Options `-e` and `-E` select old `exportAll` functionality with variable replacement and filtering
|
|
331
|
-
- Omitting options `-e` and `-E`,
|
|
351
|
+
- Omitting options `-e` and `-E`, selects the old `exportAllRaw` functionality without variable replacement and without filtering
|
|
332
352
|
- Renamed sample resource files for `idm export` command:
|
|
333
353
|
- `<frodo home>/resources/sampleEntitiesFile.json`
|
|
334
354
|
- `<frodo home>/resources/sampleEnvFile.env`
|
|
@@ -553,7 +573,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
553
573
|
- Fixed problem with adding connection profiles
|
|
554
574
|
- Miscellaneous bug fixes
|
|
555
575
|
|
|
556
|
-
[Unreleased]: https://github.com/rockcarver/frodo-lib/compare/v0.12.
|
|
576
|
+
[Unreleased]: https://github.com/rockcarver/frodo-lib/compare/v0.12.7...HEAD
|
|
577
|
+
|
|
578
|
+
[0.12.7]: https://github.com/rockcarver/frodo-lib/compare/v0.12.6...v0.12.7
|
|
579
|
+
|
|
580
|
+
[0.12.6]: https://github.com/rockcarver/frodo-lib/compare/v0.12.5...v0.12.6
|
|
557
581
|
|
|
558
582
|
[0.12.5]: https://github.com/rockcarver/frodo-lib/compare/v0.12.5-0...v0.12.5
|
|
559
583
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ScriptLanguage = exports.ScriptContext = exports.Saml2ProiderLocation = void 0;
|
|
7
|
+
var ScriptLanguage;
|
|
8
|
+
exports.ScriptLanguage = ScriptLanguage;
|
|
9
|
+
|
|
10
|
+
(function (ScriptLanguage) {
|
|
11
|
+
ScriptLanguage["GROOVY"] = "GROOVY";
|
|
12
|
+
ScriptLanguage["JAVASCRIPT"] = "JAVASCRIPT";
|
|
13
|
+
})(ScriptLanguage || (exports.ScriptLanguage = ScriptLanguage = {}));
|
|
14
|
+
|
|
15
|
+
var ScriptContext;
|
|
16
|
+
exports.ScriptContext = ScriptContext;
|
|
17
|
+
|
|
18
|
+
(function (ScriptContext) {
|
|
19
|
+
ScriptContext["OAUTH2_ACCESS_TOKEN_MODIFICATION"] = "OAUTH2_ACCESS_TOKEN_MODIFICATION";
|
|
20
|
+
ScriptContext["AUTHENTICATION_CLIENT_SIDE"] = "AUTHENTICATION_CLIENT_SIDE";
|
|
21
|
+
ScriptContext["AUTHENTICATION_TREE_DECISION_NODE"] = "AUTHENTICATION_TREE_DECISION_NODE";
|
|
22
|
+
ScriptContext["AUTHENTICATION_SERVER_SIDE"] = "AUTHENTICATION_SERVER_SIDE";
|
|
23
|
+
ScriptContext["SOCIAL_IDP_PROFILE_TRANSFORMATION"] = "SOCIAL_IDP_PROFILE_TRANSFORMATION";
|
|
24
|
+
ScriptContext["OAUTH2_VALIDATE_SCOPE"] = "OAUTH2_VALIDATE_SCOPE";
|
|
25
|
+
ScriptContext["CONFIG_PROVIDER_NODE"] = "CONFIG_PROVIDER_NODE";
|
|
26
|
+
ScriptContext["OAUTH2_AUTHORIZE_ENDPOINT_DATA_PROVIDER"] = "OAUTH2_AUTHORIZE_ENDPOINT_DATA_PROVIDER";
|
|
27
|
+
ScriptContext["OAUTH2_EVALUATE_SCOPE"] = "OAUTH2_EVALUATE_SCOPE";
|
|
28
|
+
ScriptContext["POLICY_CONDITION"] = "POLICY_CONDITION";
|
|
29
|
+
ScriptContext["OIDC_CLAIMS"] = "OIDC_CLAIMS";
|
|
30
|
+
ScriptContext["SAML2_IDP_ADAPTER"] = "SAML2_IDP_ADAPTER";
|
|
31
|
+
ScriptContext["SAML2_IDP_ATTRIBUTE_MAPPER"] = "SAML2_IDP_ATTRIBUTE_MAPPER";
|
|
32
|
+
ScriptContext["OAUTH2_MAY_ACT"] = "OAUTH2_MAY_ACT";
|
|
33
|
+
})(ScriptContext || (exports.ScriptContext = ScriptContext = {}));
|
|
34
|
+
|
|
35
|
+
var Saml2ProiderLocation;
|
|
36
|
+
exports.Saml2ProiderLocation = Saml2ProiderLocation;
|
|
37
|
+
|
|
38
|
+
(function (Saml2ProiderLocation) {
|
|
39
|
+
Saml2ProiderLocation["HOSTED"] = "hosted";
|
|
40
|
+
Saml2ProiderLocation["REMOTE"] = "remote";
|
|
41
|
+
})(Saml2ProiderLocation || (exports.Saml2ProiderLocation = Saml2ProiderLocation = {}));
|
|
42
|
+
//# sourceMappingURL=ApiTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiTypes.js","names":["ScriptLanguage","ScriptContext","Saml2ProiderLocation"],"sources":["api/ApiTypes.ts"],"sourcesContent":["interface ObjectSkeletonInterface {\n _id: string;\n _rev?: number;\n [k: string]: string | number | ObjectSkeletonInterface;\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 = ObjectSkeletonInterface & {\n entryNodeId: string;\n nodes: Record<string, NodeRefSkeletonInterface>;\n identityResource?: string;\n uiConfig?: UiConfigInterface;\n enabled?: boolean;\n};\n\nexport type AmServiceType = ObjectSkeletonInterface & {\n name: string;\n};\n\nexport type NodeSkeleton = ObjectSkeletonInterface & {\n _type: AmServiceType;\n nodes?: InnerNodeRefSkeletonInterface[];\n tree?: string;\n identityResource?: string;\n};\n\nexport type SocialIdpSkeleton = ObjectSkeletonInterface & {\n _type: AmServiceType;\n enabled: boolean;\n};\n\nexport type EmailTemplateSkeleton = ObjectSkeletonInterface & {\n defaultLocale?: string;\n displayName?: string;\n enabled?: boolean;\n from: string;\n subject: Record<string, string>;\n};\n\nexport type ThemeSkeleton = ObjectSkeletonInterface & {\n name: string;\n isDefault: boolean;\n linkedTrees: string[];\n};\n\nexport enum ScriptLanguage {\n GROOVY = 'GROOVY',\n JAVASCRIPT = 'JAVASCRIPT',\n}\n\nexport enum ScriptContext {\n OAUTH2_ACCESS_TOKEN_MODIFICATION = 'OAUTH2_ACCESS_TOKEN_MODIFICATION',\n AUTHENTICATION_CLIENT_SIDE = 'AUTHENTICATION_CLIENT_SIDE',\n AUTHENTICATION_TREE_DECISION_NODE = 'AUTHENTICATION_TREE_DECISION_NODE',\n AUTHENTICATION_SERVER_SIDE = 'AUTHENTICATION_SERVER_SIDE',\n SOCIAL_IDP_PROFILE_TRANSFORMATION = 'SOCIAL_IDP_PROFILE_TRANSFORMATION',\n OAUTH2_VALIDATE_SCOPE = 'OAUTH2_VALIDATE_SCOPE',\n CONFIG_PROVIDER_NODE = 'CONFIG_PROVIDER_NODE',\n OAUTH2_AUTHORIZE_ENDPOINT_DATA_PROVIDER = 'OAUTH2_AUTHORIZE_ENDPOINT_DATA_PROVIDER',\n OAUTH2_EVALUATE_SCOPE = 'OAUTH2_EVALUATE_SCOPE',\n POLICY_CONDITION = 'POLICY_CONDITION',\n OIDC_CLAIMS = 'OIDC_CLAIMS',\n SAML2_IDP_ADAPTER = 'SAML2_IDP_ADAPTER',\n SAML2_IDP_ATTRIBUTE_MAPPER = 'SAML2_IDP_ATTRIBUTE_MAPPER',\n OAUTH2_MAY_ACT = 'OAUTH2_MAY_ACT',\n}\n\nexport type ScriptSkeleton = ObjectSkeletonInterface & {\n name: string;\n description: string;\n isDefault: boolean;\n script: string;\n language: ScriptLanguage;\n context: 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 Saml2ProviderSkeleton = ObjectSkeletonInterface & {\n entityId: string;\n entityLocation: Saml2ProiderLocation;\n serviceProvider: unknown;\n identityProvider: unknown;\n attributeQueryProvider: unknown;\n xacmlPolicyEnforcementPoint: unknown;\n};\n\nexport type CircleOfTrustSkeleton = ObjectSkeletonInterface & {\n _type: AmServiceType;\n status: string;\n trustedProviders: string[];\n};\n"],"mappings":";;;;;;IA8DYA,c;;;WAAAA,c;EAAAA,c;EAAAA,c;GAAAA,c,8BAAAA,c;;IAKAC,a;;;WAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;EAAAA,a;GAAAA,a,6BAAAA,a;;IA8BAC,oB;;;WAAAA,oB;EAAAA,oB;EAAAA,oB;GAAAA,oB,oCAAAA,oB"}
|
package/cjs/api/Saml2Api.js
CHANGED
|
@@ -54,7 +54,7 @@ function getProviders() {
|
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Find all providers matching the filter and return the requested fields
|
|
57
|
-
* @param {string} filter CREST filter string, eg "entityId+eq+'${entityId}'"
|
|
57
|
+
* @param {string} filter CREST filter string, eg "entityId+eq+'${entityId}'" or "true" for all providers
|
|
58
58
|
* @param {string} fields Comma-delimited list of fields to include in the response
|
|
59
59
|
* @returns {Promise} a promise that resolves to an object containing an array of saml2 entities
|
|
60
60
|
*/
|
package/cjs/api/Saml2Api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Saml2Api.js","names":["providerByLocationAndIdURLTemplate","createHostedProviderURLTemplate","createRemoteProviderURLTemplate","queryAllProvidersURLTemplate","queryProvidersByEntityIdURLTemplate","metadataByEntityIdURLTemplate","apiVersion","getApiConfig","configPath","getCurrentRealmPath","path","getProviders","urlString","util","format","storage","session","getTenant","data","generateAmApi","get","withCredentials","findProviders","filter","fields","encodeURIComponent","getProviderByLocationAndId","location","entityId64","getProvider","entityId","response","resultCount","Error","result","id","_id","getProviderMetadataUrl","getRealm","getProviderMetadata","createProvider","providerData","metaData","postData","_","cloneDeep","standardMetadata","post","updateProvider","put"],"sources":["api/Saml2Api.ts"],"sourcesContent":["import util from 'util';\nimport _ from 'lodash';\nimport { generateAmApi } from './BaseApi';\nimport { getCurrentRealmPath } from './utils/ApiUtils';\nimport storage from '../storage/SessionStorage';\n\nconst providerByLocationAndIdURLTemplate = '%s/json%s/realm-config/saml2/%s/%s';\nconst createHostedProviderURLTemplate =\n '%s/json%s/realm-config/saml2/hosted/?_action=create';\nconst createRemoteProviderURLTemplate =\n '%s/json%s/realm-config/saml2/remote/?_action=importEntity';\nconst queryAllProvidersURLTemplate =\n '%s/json%s/realm-config/saml2?_queryFilter=true';\nconst queryProvidersByEntityIdURLTemplate =\n '%s/json%s/realm-config/saml2?_queryFilter=%s&_fields=%s';\nconst metadataByEntityIdURLTemplate =\n '%s/saml2/jsp/exportmetadata.jsp?entityid=%s&realm=%s';\nconst apiVersion = 'protocol=2.1,resource=1.0';\nconst getApiConfig = () => {\n const configPath = getCurrentRealmPath();\n return {\n path: `${configPath}/realm-config/saml2`,\n apiVersion,\n };\n};\n\n/**\n * Get all SAML2 entity providers\n * @returns {Promise} a promise that resolves to an array of saml2 entity stubs\n */\nexport async function getProviders() {\n const urlString = util.format(\n queryAllProvidersURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath()\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Find all providers matching the filter and return the requested fields\n * @param {string} filter CREST filter string, eg \"entityId+eq+'${entityId}'\"\n * @param {string} fields Comma-delimited list of fields to include in the response\n * @returns {Promise} a promise that resolves to an object containing an array of saml2 entities\n */\nexport async function findProviders(filter = 'true', fields = '*') {\n const urlString = util.format(\n queryProvidersByEntityIdURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath(),\n encodeURIComponent(filter),\n fields\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Geta SAML2 entity provider by location and id\n * @param {string} location Entity provider location (hosted or remote)\n * @param {string} entityId64 Base64-encoded provider entity id\n * @returns {Promise} a promise that resolves to a saml2 entity provider object\n */\nexport async function getProviderByLocationAndId(\n location: string,\n entityId64: string\n) {\n const urlString = util.format(\n providerByLocationAndIdURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath(),\n location,\n entityId64\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get SAML2 entity provider by entity id\n * @param {string} entityId Provider entity id\n * @returns {Promise} a promise that resolves to a saml2 entity provider object or null\n */\nexport async function getProvider(entityId) {\n const response = await findProviders(`entityId eq '${entityId}'`, 'location');\n switch (response.resultCount) {\n case 0:\n throw new Error(`No provider with entity id '${entityId}' found`);\n case 1: {\n const { location } = response.result[0];\n const id = response.result[0]._id;\n return getProviderByLocationAndId(location, id);\n }\n default:\n throw new Error(`Multiple providers with entity id '${entityId}' found`);\n }\n}\n\n/**\n * Get a SAML2 entity provider's metadata URL by entity id\n * @param {string} entityId SAML2 entity id\n * @returns {string} the URL to get the metadata from\n */\nexport function getProviderMetadataUrl(entityId) {\n return util.format(\n metadataByEntityIdURLTemplate,\n storage.session.getTenant(),\n encodeURIComponent(entityId),\n storage.session.getRealm()\n );\n}\n\n/**\n * Get a SAML2 entity provider's metadata by entity id\n * @param {String} entityId SAML2 entity id\n * @returns {Promise} a promise that resolves to an object containing a SAML2 metadata\n */\nexport async function getProviderMetadata(entityId) {\n const { data } = await generateAmApi(getApiConfig()).get(\n getProviderMetadataUrl(entityId),\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Create a SAML2 entity provider\n * @param {String} location 'hosted' or 'remote'\n * @param {Object} providerData Object representing a SAML entity provider\n * @param {String} metaData Base64-encoded metadata XML. Only required for remote providers\n * @returns {Promise} a promise that resolves to a saml2 entity provider object\n */\nexport async function createProvider(location, providerData, metaData) {\n let postData = _.cloneDeep(providerData);\n let urlString = util.format(\n createHostedProviderURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath()\n );\n\n if (location === 'remote') {\n /**\n * Remote entity providers must be created using XML metadata\n */\n urlString = util.format(\n createRemoteProviderURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath()\n );\n postData = {\n standardMetadata: metaData,\n };\n }\n\n const { data } = await generateAmApi(getApiConfig()).post(\n urlString,\n postData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Update SAML2 entity provider\n * @param {String} location Entity provider location (hosted or remote)\n * @param {Object} providerData Object representing a SAML entity provider\n * @returns {Promise} a promise that resolves to a saml2 entity provider object\n */\nexport async function updateProvider(location, providerData) {\n const urlString = util.format(\n providerByLocationAndIdURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath(),\n location,\n providerData._id\n );\n const { data } = await generateAmApi(getApiConfig()).put(\n urlString,\n providerData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,kCAAkC,GAAG,oCAA3C;AACA,IAAMC,+BAA+B,GACnC,qDADF;AAEA,IAAMC,+BAA+B,GACnC,2DADF;AAEA,IAAMC,4BAA4B,GAChC,gDADF;AAEA,IAAMC,mCAAmC,GACvC,yDADF;AAEA,IAAMC,6BAA6B,GACjC,sDADF;AAEA,IAAMC,UAAU,GAAG,2BAAnB;;AACA,IAAMC,YAAY,GAAG,MAAM;EACzB,IAAMC,UAAU,GAAG,IAAAC,6BAAA,GAAnB;EACA,OAAO;IACLC,IAAI,YAAKF,UAAL,wBADC;IAELF;EAFK,CAAP;AAID,CAND;AA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.js","names":["providerByLocationAndIdURLTemplate","createHostedProviderURLTemplate","createRemoteProviderURLTemplate","queryAllProvidersURLTemplate","queryProvidersByEntityIdURLTemplate","metadataByEntityIdURLTemplate","apiVersion","getApiConfig","configPath","getCurrentRealmPath","path","getProviders","urlString","util","format","storage","session","getTenant","data","generateAmApi","get","withCredentials","findProviders","filter","fields","encodeURIComponent","getProviderByLocationAndId","location","entityId64","getProvider","entityId","response","resultCount","Error","result","id","_id","getProviderMetadataUrl","getRealm","getProviderMetadata","createProvider","providerData","metaData","postData","_","cloneDeep","standardMetadata","post","updateProvider","put"],"sources":["api/Saml2Api.ts"],"sourcesContent":["import util from 'util';\nimport _ from 'lodash';\nimport { generateAmApi } from './BaseApi';\nimport { getCurrentRealmPath } from './utils/ApiUtils';\nimport storage from '../storage/SessionStorage';\n\nconst providerByLocationAndIdURLTemplate = '%s/json%s/realm-config/saml2/%s/%s';\nconst createHostedProviderURLTemplate =\n '%s/json%s/realm-config/saml2/hosted/?_action=create';\nconst createRemoteProviderURLTemplate =\n '%s/json%s/realm-config/saml2/remote/?_action=importEntity';\nconst queryAllProvidersURLTemplate =\n '%s/json%s/realm-config/saml2?_queryFilter=true';\nconst queryProvidersByEntityIdURLTemplate =\n '%s/json%s/realm-config/saml2?_queryFilter=%s&_fields=%s';\nconst metadataByEntityIdURLTemplate =\n '%s/saml2/jsp/exportmetadata.jsp?entityid=%s&realm=%s';\nconst apiVersion = 'protocol=2.1,resource=1.0';\nconst getApiConfig = () => {\n const configPath = getCurrentRealmPath();\n return {\n path: `${configPath}/realm-config/saml2`,\n apiVersion,\n };\n};\n\n/**\n * Get all SAML2 entity providers\n * @returns {Promise} a promise that resolves to an array of saml2 entity stubs\n */\nexport async function getProviders() {\n const urlString = util.format(\n queryAllProvidersURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath()\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Find all providers matching the filter and return the requested fields\n * @param {string} filter CREST filter string, eg \"entityId+eq+'${entityId}'\" or \"true\" for all providers\n * @param {string} fields Comma-delimited list of fields to include in the response\n * @returns {Promise} a promise that resolves to an object containing an array of saml2 entities\n */\nexport async function findProviders(filter = 'true', fields = '*') {\n const urlString = util.format(\n queryProvidersByEntityIdURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath(),\n encodeURIComponent(filter),\n fields\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Geta SAML2 entity provider by location and id\n * @param {string} location Entity provider location (hosted or remote)\n * @param {string} entityId64 Base64-encoded provider entity id\n * @returns {Promise} a promise that resolves to a saml2 entity provider object\n */\nexport async function getProviderByLocationAndId(\n location: string,\n entityId64: string\n) {\n const urlString = util.format(\n providerByLocationAndIdURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath(),\n location,\n entityId64\n );\n const { data } = await generateAmApi(getApiConfig()).get(urlString, {\n withCredentials: true,\n });\n return data;\n}\n\n/**\n * Get SAML2 entity provider by entity id\n * @param {string} entityId Provider entity id\n * @returns {Promise} a promise that resolves to a saml2 entity provider object or null\n */\nexport async function getProvider(entityId) {\n const response = await findProviders(`entityId eq '${entityId}'`, 'location');\n switch (response.resultCount) {\n case 0:\n throw new Error(`No provider with entity id '${entityId}' found`);\n case 1: {\n const { location } = response.result[0];\n const id = response.result[0]._id;\n return getProviderByLocationAndId(location, id);\n }\n default:\n throw new Error(`Multiple providers with entity id '${entityId}' found`);\n }\n}\n\n/**\n * Get a SAML2 entity provider's metadata URL by entity id\n * @param {string} entityId SAML2 entity id\n * @returns {string} the URL to get the metadata from\n */\nexport function getProviderMetadataUrl(entityId) {\n return util.format(\n metadataByEntityIdURLTemplate,\n storage.session.getTenant(),\n encodeURIComponent(entityId),\n storage.session.getRealm()\n );\n}\n\n/**\n * Get a SAML2 entity provider's metadata by entity id\n * @param {String} entityId SAML2 entity id\n * @returns {Promise} a promise that resolves to an object containing a SAML2 metadata\n */\nexport async function getProviderMetadata(entityId) {\n const { data } = await generateAmApi(getApiConfig()).get(\n getProviderMetadataUrl(entityId),\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Create a SAML2 entity provider\n * @param {String} location 'hosted' or 'remote'\n * @param {Object} providerData Object representing a SAML entity provider\n * @param {String} metaData Base64-encoded metadata XML. Only required for remote providers\n * @returns {Promise} a promise that resolves to a saml2 entity provider object\n */\nexport async function createProvider(location, providerData, metaData) {\n let postData = _.cloneDeep(providerData);\n let urlString = util.format(\n createHostedProviderURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath()\n );\n\n if (location === 'remote') {\n /**\n * Remote entity providers must be created using XML metadata\n */\n urlString = util.format(\n createRemoteProviderURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath()\n );\n postData = {\n standardMetadata: metaData,\n };\n }\n\n const { data } = await generateAmApi(getApiConfig()).post(\n urlString,\n postData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n\n/**\n * Update SAML2 entity provider\n * @param {String} location Entity provider location (hosted or remote)\n * @param {Object} providerData Object representing a SAML entity provider\n * @returns {Promise} a promise that resolves to a saml2 entity provider object\n */\nexport async function updateProvider(location, providerData) {\n const urlString = util.format(\n providerByLocationAndIdURLTemplate,\n storage.session.getTenant(),\n getCurrentRealmPath(),\n location,\n providerData._id\n );\n const { data } = await generateAmApi(getApiConfig()).put(\n urlString,\n providerData,\n {\n withCredentials: true,\n }\n );\n return data;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,kCAAkC,GAAG,oCAA3C;AACA,IAAMC,+BAA+B,GACnC,qDADF;AAEA,IAAMC,+BAA+B,GACnC,2DADF;AAEA,IAAMC,4BAA4B,GAChC,gDADF;AAEA,IAAMC,mCAAmC,GACvC,yDADF;AAEA,IAAMC,6BAA6B,GACjC,sDADF;AAEA,IAAMC,UAAU,GAAG,2BAAnB;;AAC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C,GAA9B,CACrBrC,SADqB,EAErB6B,YAFqB,EAGrB;MACEpB,eAAe,EAAE;IADnB,CAHqB,CAAvB;IAOA,OAAOH,IAAP;EACD,C"}
|
package/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.VariablesRaw = exports.Variables = exports.Utils = exports.TreeRaw = exports.Theme = exports.StartupRaw = exports.Startup = exports.SecretsRaw = exports.Secrets = exports.Script = exports.Saml2 = exports.Realm = exports.Organization = exports.OAuth2OIDCApi = exports.OAuth2Client = exports.NodeRaw = exports.ManagedObject = exports.Log = exports.Journey = exports.Idp = exports.Idm = exports.EmailTemplate = exports.ConnectionProfile = exports.CirclesOfTrust = exports.Authenticate = exports.Admin = void 0;
|
|
6
|
+
exports.VariablesRaw = exports.Variables = exports.Utils = exports.TypesRaw = exports.Types = exports.TreeRaw = exports.Theme = exports.StartupRaw = exports.Startup = exports.SecretsRaw = exports.Secrets = exports.Script = exports.Saml2 = exports.Realm = exports.Organization = exports.OAuth2OIDCApi = exports.OAuth2Client = exports.NodeRaw = exports.Node = exports.ManagedObject = exports.Log = exports.Journey = exports.Idp = exports.Idm = exports.EmailTemplate = exports.ConnectionProfile = exports.CirclesOfTrust = exports.Authenticate = exports.Admin = void 0;
|
|
7
7
|
exports.getVersion = getVersion;
|
|
8
8
|
exports.state = void 0;
|
|
9
9
|
|
|
@@ -13,6 +13,12 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
13
13
|
|
|
14
14
|
var _url = require("url");
|
|
15
15
|
|
|
16
|
+
var _colors = _interopRequireDefault(require("colors"));
|
|
17
|
+
|
|
18
|
+
var _TypesRaw = _interopRequireWildcard(require("./api/ApiTypes"));
|
|
19
|
+
|
|
20
|
+
exports.TypesRaw = _TypesRaw;
|
|
21
|
+
|
|
16
22
|
var _NodeRaw = _interopRequireWildcard(require("./api/NodeApi"));
|
|
17
23
|
|
|
18
24
|
exports.NodeRaw = _NodeRaw;
|
|
@@ -33,6 +39,10 @@ var _VariablesRaw = _interopRequireWildcard(require("./api/VariablesApi"));
|
|
|
33
39
|
|
|
34
40
|
exports.VariablesRaw = _VariablesRaw;
|
|
35
41
|
|
|
42
|
+
var _Types = _interopRequireWildcard(require("./ops/OpsTypes"));
|
|
43
|
+
|
|
44
|
+
exports.Types = _Types;
|
|
45
|
+
|
|
36
46
|
var _Admin = _interopRequireWildcard(require("./ops/AdminOps"));
|
|
37
47
|
|
|
38
48
|
exports.Admin = _Admin;
|
|
@@ -81,6 +91,10 @@ var _Organization = _interopRequireWildcard(require("./ops/OrganizationOps"));
|
|
|
81
91
|
|
|
82
92
|
exports.Organization = _Organization;
|
|
83
93
|
|
|
94
|
+
var _Node = _interopRequireWildcard(require("./ops/NodeOps"));
|
|
95
|
+
|
|
96
|
+
exports.Node = _Node;
|
|
97
|
+
|
|
84
98
|
var _Realm = _interopRequireWildcard(require("./ops/RealmOps"));
|
|
85
99
|
|
|
86
100
|
exports.Realm = _Realm;
|
|
@@ -127,6 +141,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
127
141
|
|
|
128
142
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
129
143
|
|
|
144
|
+
_colors.default.enable();
|
|
145
|
+
|
|
130
146
|
var _dirname = _path.default.dirname((0, _url.fileURLToPath)(require('url').pathToFileURL(__filename).toString()));
|
|
131
147
|
|
|
132
148
|
var pkg = JSON.parse(_fs.default.readFileSync(_path.default.resolve(_dirname, '../package.json'), 'utf8'));
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["__dirname","path","dirname","fileURLToPath","pkg","JSON","parse","fs","readFileSync","resolve","getVersion","version"],"sources":["index.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nconst pkg = JSON.parse(\n fs.readFileSync(path.resolve(__dirname, '../package.json'), 'utf8')\n);\n\nexport function getVersion() {\n return `v${pkg.version}`;\n}\n\n// Api Layer\nexport * as NodeRaw from './api/NodeApi';\nexport * as TreeRaw from './api/TreeApi';\nexport * as StartupRaw from './api/StartupApi';\nexport * as SecretsRaw from './api/SecretsApi';\nexport * as VariablesRaw from './api/VariablesApi';\n\n// Ops Layer\nexport * as Admin from './ops/AdminOps';\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 Idm from './ops/IdmOps';\nexport * as Idp from './ops/IdpOps';\nexport * as Journey from './ops/JourneyOps';\nexport * as Log from './ops/LogOps';\nexport * as ManagedObject from './ops/ManagedObjectOps';\nexport * as OAuth2Client from './ops/OAuth2ClientOps';\nexport * as Organization from './ops/OrganizationOps';\nexport * as Realm from './ops/RealmOps';\nexport * as Saml2 from './ops/Saml2Ops';\nexport * as Script from './ops/ScriptOps';\nexport * as Secrets from './ops/SecretsOps';\nexport * as Startup from './ops/StartupOps';\nexport * as Theme from './ops/ThemeOps';\nexport * as Variables from './ops/VariablesOps';\n// TODO: revisit if there are better ways\nexport * as Utils from './ops/utils/OpsUtils';\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 './storage/SessionStorage';\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';\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA
|
|
1
|
+
{"version":3,"file":"index.js","names":["Color","enable","__dirname","path","dirname","fileURLToPath","pkg","JSON","parse","fs","readFileSync","resolve","getVersion","version"],"sources":["index.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport Color from 'colors';\n\nColor.enable();\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nconst pkg = JSON.parse(\n fs.readFileSync(path.resolve(__dirname, '../package.json'), 'utf8')\n);\n\nexport function getVersion() {\n return `v${pkg.version}`;\n}\n\n// Api Layer\nexport * as TypesRaw from './api/ApiTypes';\nexport * as NodeRaw from './api/NodeApi';\nexport * as TreeRaw from './api/TreeApi';\nexport * as StartupRaw from './api/StartupApi';\nexport * as SecretsRaw from './api/SecretsApi';\nexport * as VariablesRaw from './api/VariablesApi';\n\n// Ops Layer\nexport * as Types from './ops/OpsTypes';\nexport * as Admin from './ops/AdminOps';\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 Idm from './ops/IdmOps';\nexport * as Idp from './ops/IdpOps';\nexport * as Journey from './ops/JourneyOps';\nexport * as Log from './ops/LogOps';\nexport * as ManagedObject from './ops/ManagedObjectOps';\nexport * as OAuth2Client from './ops/OAuth2ClientOps';\nexport * as Organization from './ops/OrganizationOps';\nexport * as Node from './ops/NodeOps';\nexport * as Realm from './ops/RealmOps';\nexport * as Saml2 from './ops/Saml2Ops';\nexport * as Script from './ops/ScriptOps';\nexport * as Secrets from './ops/SecretsOps';\nexport * as Startup from './ops/StartupOps';\nexport * as Theme from './ops/ThemeOps';\nexport * as Variables from './ops/VariablesOps';\n// TODO: revisit if there are better ways\nexport * as Utils from './ops/utils/OpsUtils';\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 './storage/SessionStorage';\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';\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEAA,eAAA,CAAMC,MAAN;;AAEA,IAAMC,QAAS,GAAGC,aAAA,CAAKC,OAAL,CAAa,IAAAC,kBAAA,sDAAb,CAAlB;;AAEA,IAAMC,GAAG,GAAGC,IAAI,CAACC,KAAL,CACVC,WAAA,CAAGC,YAAH,CAAgBP,aAAA,CAAKQ,OAAL,CAAaT,QAAb,EAAwB,iBAAxB,CAAhB,EAA4D,MAA5D,CADU,CAAZ;;AAIO,SAASU,UAAT,GAAsB;EAC3B,kBAAWN,GAAG,CAACO,OAAf;AACD,C,CAED"}
|