@rockcarver/frodo-lib 0.16.2-8 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +221 -1
- package/cjs/api/AgentApi.js +14 -61
- package/cjs/api/AgentApi.js.map +1 -1
- package/cjs/api/AgentApi.test.js.map +1 -1
- package/cjs/api/ApiTypes.js +0 -5
- package/cjs/api/ApiTypes.js.map +1 -1
- package/cjs/api/AuthenticateApi.js +9 -20
- package/cjs/api/AuthenticateApi.js.map +1 -1
- package/cjs/api/AuthenticateApi.test.js.map +1 -0
- package/cjs/api/BaseApi.js +82 -124
- package/cjs/api/BaseApi.js.map +1 -1
- package/cjs/api/CirclesOfTrustApi.js +8 -32
- package/cjs/api/CirclesOfTrustApi.js.map +1 -1
- package/cjs/api/IdmConfigApi.js +9 -34
- package/cjs/api/IdmConfigApi.js.map +1 -1
- package/cjs/api/LogApi.js +8 -31
- package/cjs/api/LogApi.js.map +1 -1
- package/cjs/api/ManagedObjectApi.js +34 -31
- package/cjs/api/ManagedObjectApi.js.map +1 -1
- package/cjs/api/NodeApi.js +10 -41
- package/cjs/api/NodeApi.js.map +1 -1
- package/cjs/api/NodeApi.test.js.map +1 -1
- package/cjs/api/OAuth2ClientApi.js +7 -26
- package/cjs/api/OAuth2ClientApi.js.map +1 -1
- package/cjs/api/OAuth2OIDCApi.js +28 -34
- package/cjs/api/OAuth2OIDCApi.js.map +1 -1
- package/cjs/api/OAuth2OIDCApi.test.js.map +1 -0
- package/cjs/api/OAuth2ProviderApi.js +5 -15
- package/cjs/api/OAuth2ProviderApi.js.map +1 -1
- package/cjs/api/RealmApi.js +8 -34
- package/cjs/api/RealmApi.js.map +1 -1
- package/cjs/api/Saml2Api.js +32 -118
- package/cjs/api/Saml2Api.js.map +1 -1
- package/cjs/api/ScriptApi.js +8 -30
- package/cjs/api/ScriptApi.js.map +1 -1
- package/cjs/api/SecretsApi.js +14 -64
- package/cjs/api/SecretsApi.js.map +1 -1
- package/cjs/api/SecretsApi.test.js.map +1 -1
- package/cjs/api/ServerInfoApi.js +6 -21
- package/cjs/api/ServerInfoApi.js.map +1 -1
- package/cjs/api/ServiceApi.js +49 -47
- package/cjs/api/ServiceApi.js.map +1 -1
- package/cjs/api/SocialIdentityProvidersApi.js +9 -36
- package/cjs/api/SocialIdentityProvidersApi.js.map +1 -1
- package/cjs/api/StartupApi.js +5 -24
- package/cjs/api/StartupApi.js.map +1 -1
- package/cjs/api/StartupApi.test.js.map +1 -1
- package/cjs/api/TreeApi.js +8 -30
- package/cjs/api/TreeApi.js.map +1 -1
- package/cjs/api/TreeApi.test.js.map +1 -1
- package/cjs/api/VariablesApi.js +9 -37
- package/cjs/api/VariablesApi.js.map +1 -1
- package/cjs/api/VariablesApi.test.js.map +1 -1
- package/cjs/api/utils/ApiUtils.js +47 -57
- package/cjs/api/utils/ApiUtils.js.map +1 -1
- package/cjs/api/utils/ApiUtils.test.js.map +1 -1
- package/cjs/api/utils/Base64.js +6 -15
- package/cjs/api/utils/Base64.js.map +1 -1
- package/cjs/ext/axios-curlirize/curlirize.js +2 -9
- package/cjs/ext/axios-curlirize/curlirize.js.map +1 -1
- package/cjs/ext/axios-curlirize/lib/CurlHelper.js +7 -22
- package/cjs/ext/axios-curlirize/lib/CurlHelper.js.map +1 -1
- package/cjs/index.js +30 -89
- package/cjs/index.js.map +1 -1
- package/cjs/ops/AdminOps.js +27 -165
- package/cjs/ops/AdminOps.js.map +1 -1
- package/cjs/ops/AgentOps.js +3 -160
- package/cjs/ops/AgentOps.js.map +1 -1
- package/cjs/ops/AgentOps.test.js.map +1 -1
- package/cjs/ops/AuthenticateOps.js +265 -226
- package/cjs/ops/AuthenticateOps.js.map +1 -1
- package/cjs/ops/AuthenticateOps.test.js.map +1 -1
- package/cjs/ops/CirclesOfTrustOps.js +13 -91
- package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.js +220 -136
- package/cjs/ops/ConnectionProfileOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.test.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.js +35 -379
- package/cjs/ops/EmailTemplateOps.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.test.js.map +1 -1
- package/cjs/ops/IdmOps.js +52 -426
- package/cjs/ops/IdmOps.js.map +1 -1
- package/cjs/ops/IdmOps.test.js.map +1 -1
- package/cjs/ops/IdpOps.js +11 -94
- package/cjs/ops/IdpOps.js.map +1 -1
- package/cjs/ops/IdpOps.test.js.map +1 -1
- package/cjs/ops/JoseOps.js +81 -0
- package/cjs/ops/JoseOps.js.map +1 -0
- package/cjs/ops/JoseOps.test.js.map +1 -0
- package/cjs/ops/JourneyOps.js +140 -371
- package/cjs/ops/JourneyOps.js.map +1 -1
- package/cjs/ops/JourneyOps.test.js.map +1 -1
- package/cjs/ops/LogOps.js +14 -47
- package/cjs/ops/LogOps.js.map +1 -1
- package/cjs/ops/ManagedObjectOps.js +4 -12
- package/cjs/ops/ManagedObjectOps.js.map +1 -1
- package/cjs/ops/NodeOps.js +9 -67
- package/cjs/ops/NodeOps.js.map +1 -1
- package/cjs/ops/OAuth2ClientOps.js +10 -40
- package/cjs/ops/OAuth2ClientOps.js.map +1 -1
- package/cjs/ops/OpsTypes.js +0 -5
- package/cjs/ops/OpsTypes.js.map +1 -1
- package/cjs/ops/OrganizationOps.js +6 -25
- package/cjs/ops/OrganizationOps.js.map +1 -1
- package/cjs/ops/RealmOps.js +0 -19
- package/cjs/ops/RealmOps.js.map +1 -1
- package/cjs/ops/Saml2Ops.js +258 -802
- package/cjs/ops/Saml2Ops.js.map +1 -1
- package/cjs/ops/Saml2Ops.test.js.map +1 -1
- package/cjs/ops/ScriptOps.js +28 -73
- package/cjs/ops/ScriptOps.js.map +1 -1
- package/cjs/ops/SecretsOps.js +2 -58
- package/cjs/ops/SecretsOps.js.map +1 -1
- package/cjs/ops/ServiceAccountOps.js +61 -0
- package/cjs/ops/ServiceAccountOps.js.map +1 -0
- package/cjs/ops/ServiceAccountOps.test.js.map +1 -0
- package/cjs/ops/ServiceOps.js +55 -101
- package/cjs/ops/ServiceOps.js.map +1 -1
- package/cjs/ops/StartupOps.js +2 -23
- package/cjs/ops/StartupOps.js.map +1 -1
- package/cjs/ops/ThemeOps.js +230 -436
- package/cjs/ops/ThemeOps.js.map +1 -1
- package/cjs/ops/ThemeOps.test.js.map +1 -0
- package/cjs/ops/VariablesOps.js +0 -38
- package/cjs/ops/VariablesOps.js.map +1 -1
- package/cjs/ops/utils/Console.js +29 -62
- package/cjs/ops/utils/Console.js.map +1 -1
- package/cjs/ops/utils/DataProtection.js +13 -47
- package/cjs/ops/utils/DataProtection.js.map +1 -1
- package/cjs/ops/utils/DataProtection.test.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.js +36 -74
- package/cjs/ops/utils/ExportImportUtils.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.test.js.map +1 -1
- package/cjs/ops/utils/OpsUtils.js +27 -43
- package/cjs/ops/utils/OpsUtils.js.map +1 -1
- package/cjs/ops/utils/OpsUtils.test.js.map +1 -1
- package/cjs/ops/utils/ValidationUtils.js +0 -13
- package/cjs/ops/utils/ValidationUtils.js.map +1 -1
- package/cjs/ops/utils/ValidationUtils.test.js.map +1 -1
- package/cjs/ops/utils/Version.js +2 -12
- package/cjs/ops/utils/Version.js.map +1 -1
- package/cjs/ops/utils/Version.test.js.map +1 -1
- package/cjs/ops/utils/Wordwrap.js +1 -2
- package/cjs/ops/utils/Wordwrap.js.map +1 -1
- package/cjs/ops/utils/Wordwrap.test.js.map +1 -0
- package/cjs/shared/State.js +239 -0
- package/cjs/shared/State.js.map +1 -0
- package/cjs/shared/State.test.js.map +1 -0
- package/cjs/storage/StaticStorage.js.map +1 -1
- package/cjs/test/mocks/AuthenticateApi/step/default_steps.json +88 -0
- package/cjs/test/mocks/ForgeRockApiMockEngine.js +184 -80
- package/cjs/test/mocks/ForgeRockApiMockEngine.js.map +1 -1
- package/cjs/test/mocks/IdmConfigApi/getConfigEntity/managed.json +4420 -0
- package/cjs/test/mocks/OAuth2OIDCApi/accessToken/body.json +6 -0
- package/cjs/test/mocks/OAuth2OIDCApi/accessToken/headers.json +19 -0
- package/cjs/test/mocks/OAuth2OIDCApi/authorize/headers.json +38 -0
- package/cjs/test/mocks/Saml2Api/findSaml2Providers/https:sts.windows.net711ffa9c-5972-4713-ace3-688c9732614a_stub.json +18 -0
- package/cjs/test/mocks/Saml2Api/findSaml2Providers/iSPAzure_stub.json +18 -0
- package/cjs/test/mocks/Saml2Api/getProvider/aVNQQXp1cmU.json +1 -2
- package/cjs/test/mocks/Saml2Api/getProvider/dXJuOmZlZGVyYXRpb246TWljcm9zb2Z0T25saW5l.json +1 -3
- package/cjs/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/U1BBenVyZQ.json +147 -0
- package/cjs/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/aHR0cHM6Ly9pZGMuc2NoZXViZXIuaW8vYW0vc2FtbDIvSURQQXp1cmU.json +182 -0
- package/cjs/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/aHR0cHM6Ly9pZGMuc2NoZXViZXIuaW8vYW0vc2FtbDIvSURQQnJvYWRjb20.json +149 -0
- package/cjs/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/aHR0cHM6Ly9pZGMuc2NoZXViZXIuaW8vYW0vc2FtbDIvSURQRmVkbGV0.json +141 -0
- package/cjs/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/aVNQQXp1cmU.json +1 -2
- package/cjs/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/dm9sa2VyRGV2U1A.json +118 -0
- package/cjs/test/mocks/Saml2Api/getProviderByLocationAndId/remote/aHR0cHM6Ly9zYW1sLm15dGVzdHJ1bi5jb20vc3A.json +66 -0
- package/cjs/test/mocks/Saml2Api/getProviderByLocationAndId/remote/aHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzExZmZhOWMtNTk3Mi00NzEzLWFjZTMtNjg4Yzk3MzI2MTRhLw.json +35 -0
- package/cjs/test/mocks/Saml2Api/getProviderByLocationAndId/remote/aWRw.json +83 -0
- package/cjs/test/mocks/Saml2Api/getProviderByLocationAndId/remote/dXJuOmZlZGVyYXRpb246TWljcm9zb2Z0T25saW5l.json +1 -3
- package/cjs/test/mocks/Saml2Api/getProviderMetadata/alpha/SPAzure.xml +74 -0
- package/cjs/test/mocks/Saml2Api/getProviderMetadata/alpha/https%3A%2F%2Fidc.scheuber.io%2Fam%2Fsaml2%2FIDPAzure.xml +78 -0
- package/cjs/test/mocks/Saml2Api/getProviderMetadata/alpha/https%3A%2F%2Fidc.scheuber.io%2Fam%2Fsaml2%2FIDPBroadcom.xml +78 -0
- package/cjs/test/mocks/Saml2Api/getProviderMetadata/alpha/https%3A%2F%2Fidc.scheuber.io%2Fam%2Fsaml2%2FIDPFedlet.xml +78 -0
- package/cjs/test/mocks/Saml2Api/getProviderMetadata/alpha/https%3A%2F%2Fsaml.mytestrun.com%2Fsp.xml +13 -0
- package/cjs/test/mocks/Saml2Api/getProviderMetadata/alpha/{dXJuOmZlZGVyYXRpb246TWljcm9zb2Z0T25saW5l.xml → https%3A%2F%2Fsts.windows.net%2F711ffa9c-5972-4713-ace3-688c9732614a%2F.xml} +0 -0
- package/cjs/test/mocks/Saml2Api/getProviderMetadata/alpha/{aVNQQXp1cmU.xml → iSPAzure.xml} +0 -0
- package/cjs/test/mocks/Saml2Api/getProviderMetadata/alpha/urn%3Afederation%3AMicrosoftOnline.xml +84 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Provider/SPAzure.saml.json +243 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Provider/iSPAzure.saml.json +242 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Provider/idc.scheuber.ioamsaml2IDPAzure.saml.json +454 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Provider/idc.scheuber.ioamsaml2IDPBroadcom.saml.json +586 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Provider/idc.scheuber.ioamsaml2IDPFedlet.saml.json +241 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Provider/idp.saml.json +185 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Provider/saml.mytestrun.comsp.saml.json +101 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Provider/sts.windows.net711ffa9c-5972-4713-ace3-688c9732614a.saml.json +113 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Provider/urn:federation:MicrosoftOnline.saml.json +199 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Provider/volkerDevSP.saml.json +212 -0
- package/cjs/test/mocks/Saml2Ops/importSaml2Providers/allAlphaProviders.saml.json +2414 -0
- package/cjs/test/mocks/ScriptApi/getScript/5b29c5b7-b161-4a42-a41f-d6c85316b951.json +13 -0
- package/cjs/test/mocks/ScriptApi/getScript/85523e71-2d77-4577-b078-6f9674cc54e2.json +13 -0
- package/cjs/test/mocks/ScriptApi/getScript/90c4eca5-05f0-42f5-b9bf-88b693eabbbd.json +13 -0
- package/cjs/test/mocks/ServerInfoApi/getServerInfo/info.json +25 -0
- package/cjs/test/mocks/ServerInfoApi/getServerVersionInfo/version.json +8 -0
- package/cjs/utils/AutoSetupPolly.js +79 -0
- package/cjs/utils/AutoSetupPolly.js.map +1 -0
- package/cjs/utils/SetupJest.js +6 -0
- package/cjs/utils/SetupJest.js.map +1 -0
- package/cjs/{test/mocks → utils}/snapshotResolve.js +10 -12
- package/cjs/utils/snapshotResolve.js.map +1 -0
- package/esm/api/AgentApi.mjs +19 -21
- package/esm/api/AgentApi.test.mjs +6 -15
- package/esm/api/ApiTypes.mjs +0 -5
- package/esm/api/AuthenticateApi.mjs +7 -10
- package/esm/api/AuthenticateApi.test.mjs +39 -0
- package/esm/api/BaseApi.mjs +96 -81
- package/esm/api/CirclesOfTrustApi.mjs +9 -12
- package/esm/api/IdmConfigApi.mjs +11 -12
- package/esm/api/LogApi.mjs +6 -10
- package/esm/api/ManagedObjectApi.mjs +23 -8
- package/esm/api/NodeApi.mjs +13 -15
- package/esm/api/NodeApi.test.mjs +13 -17
- package/esm/api/OAuth2ClientApi.mjs +7 -9
- package/esm/api/OAuth2OIDCApi.mjs +15 -9
- package/esm/api/OAuth2OIDCApi.test.mjs +53 -0
- package/esm/api/OAuth2ProviderApi.mjs +3 -5
- package/esm/api/RealmApi.mjs +10 -13
- package/esm/api/Saml2Api.mjs +31 -61
- package/esm/api/ScriptApi.mjs +9 -11
- package/esm/api/SecretsApi.mjs +21 -24
- package/esm/api/SecretsApi.test.mjs +9 -31
- package/esm/api/ServerInfoApi.mjs +5 -9
- package/esm/api/ServiceApi.mjs +53 -26
- package/esm/api/SocialIdentityProvidersApi.mjs +11 -13
- package/esm/api/StartupApi.mjs +5 -10
- package/esm/api/StartupApi.test.mjs +4 -7
- package/esm/api/TreeApi.mjs +9 -11
- package/esm/api/TreeApi.test.mjs +24 -61
- package/esm/api/VariablesApi.mjs +11 -13
- package/esm/api/VariablesApi.test.mjs +80 -222
- package/esm/api/utils/ApiUtils.mjs +45 -48
- package/esm/api/utils/ApiUtils.test.mjs +33 -32
- package/esm/api/utils/Base64.mjs +6 -9
- package/esm/ext/axios-curlirize/curlirize.mjs +2 -7
- package/esm/ext/axios-curlirize/lib/CurlHelper.mjs +7 -20
- package/esm/index.mjs +23 -13
- package/esm/ops/AdminOps.mjs +33 -119
- package/esm/ops/AgentOps.mjs +38 -81
- package/esm/ops/AgentOps.test.mjs +5 -45
- package/esm/ops/AuthenticateOps.mjs +241 -175
- package/esm/ops/AuthenticateOps.test.mjs +7 -9
- package/esm/ops/CirclesOfTrustOps.mjs +24 -61
- package/esm/ops/ConnectionProfileOps.mjs +192 -82
- package/esm/ops/ConnectionProfileOps.test.mjs +19 -19
- package/esm/ops/EmailTemplateOps.mjs +18 -276
- package/esm/ops/EmailTemplateOps.test.mjs +19 -44
- package/esm/ops/IdmOps.mjs +30 -327
- package/esm/ops/IdmOps.test.mjs +47 -54
- package/esm/ops/IdpOps.mjs +21 -59
- package/esm/ops/IdpOps.test.mjs +5 -5
- package/esm/ops/JoseOps.mjs +41 -0
- package/esm/ops/JoseOps.test.mjs +137 -0
- package/esm/ops/JourneyOps.mjs +147 -290
- package/esm/ops/JourneyOps.test.mjs +30 -28
- package/esm/ops/LogOps.mjs +15 -25
- package/esm/ops/ManagedObjectOps.mjs +6 -6
- package/esm/ops/NodeOps.mjs +9 -47
- package/esm/ops/OAuth2ClientOps.mjs +13 -19
- package/esm/ops/OpsTypes.mjs +1 -3
- package/esm/ops/OrganizationOps.mjs +7 -14
- package/esm/ops/RealmOps.mjs +4 -7
- package/esm/ops/Saml2Ops.mjs +199 -587
- package/esm/ops/Saml2Ops.test.mjs +303 -84
- package/esm/ops/ScriptOps.mjs +31 -47
- package/esm/ops/SecretsOps.mjs +15 -31
- package/esm/ops/ServiceAccountOps.mjs +41 -0
- package/esm/ops/ServiceAccountOps.test.mjs +51 -0
- package/esm/ops/ServiceOps.mjs +66 -83
- package/esm/ops/StartupOps.mjs +4 -13
- package/esm/ops/ThemeOps.mjs +189 -298
- package/esm/{api/ThemeApi.test.mjs → ops/ThemeOps.test.mjs} +91 -96
- package/esm/ops/VariablesOps.mjs +9 -18
- package/esm/ops/utils/Console.mjs +28 -46
- package/esm/ops/utils/DataProtection.mjs +15 -28
- package/esm/ops/utils/DataProtection.test.mjs +8 -8
- package/esm/ops/utils/ExportImportUtils.mjs +34 -43
- package/esm/ops/utils/ExportImportUtils.test.mjs +20 -18
- package/esm/ops/utils/OpsUtils.mjs +27 -21
- package/esm/ops/utils/OpsUtils.test.mjs +155 -27
- package/esm/ops/utils/ValidationUtils.mjs +0 -9
- package/esm/ops/utils/Version.mjs +2 -3
- package/esm/ops/utils/Version.test.mjs +0 -2
- package/esm/ops/utils/Wordwrap.mjs +1 -1
- package/esm/ops/utils/Wordwrap.test.mjs +19 -0
- package/esm/shared/State.mjs +164 -0
- package/esm/shared/State.test.mjs +249 -0
- package/esm/test/mocks/AuthenticateApi/step/default_steps.json +88 -0
- package/esm/test/mocks/ForgeRockApiMockEngine.mjs +169 -33
- package/esm/test/mocks/IdmConfigApi/getConfigEntity/managed.json +4420 -0
- package/esm/test/mocks/OAuth2OIDCApi/accessToken/body.json +6 -0
- package/esm/test/mocks/OAuth2OIDCApi/accessToken/headers.json +19 -0
- package/esm/test/mocks/OAuth2OIDCApi/authorize/headers.json +38 -0
- package/esm/test/mocks/Saml2Api/findSaml2Providers/https:sts.windows.net711ffa9c-5972-4713-ace3-688c9732614a_stub.json +18 -0
- package/esm/test/mocks/Saml2Api/findSaml2Providers/iSPAzure_stub.json +18 -0
- package/esm/test/mocks/Saml2Api/getProvider/aVNQQXp1cmU.json +1 -2
- package/esm/test/mocks/Saml2Api/getProvider/dXJuOmZlZGVyYXRpb246TWljcm9zb2Z0T25saW5l.json +1 -3
- package/esm/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/U1BBenVyZQ.json +147 -0
- package/esm/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/aHR0cHM6Ly9pZGMuc2NoZXViZXIuaW8vYW0vc2FtbDIvSURQQXp1cmU.json +182 -0
- package/esm/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/aHR0cHM6Ly9pZGMuc2NoZXViZXIuaW8vYW0vc2FtbDIvSURQQnJvYWRjb20.json +149 -0
- package/esm/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/aHR0cHM6Ly9pZGMuc2NoZXViZXIuaW8vYW0vc2FtbDIvSURQRmVkbGV0.json +141 -0
- package/esm/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/aVNQQXp1cmU.json +1 -2
- package/esm/test/mocks/Saml2Api/getProviderByLocationAndId/hosted/dm9sa2VyRGV2U1A.json +118 -0
- package/esm/test/mocks/Saml2Api/getProviderByLocationAndId/remote/aHR0cHM6Ly9zYW1sLm15dGVzdHJ1bi5jb20vc3A.json +66 -0
- package/esm/test/mocks/Saml2Api/getProviderByLocationAndId/remote/aHR0cHM6Ly9zdHMud2luZG93cy5uZXQvNzExZmZhOWMtNTk3Mi00NzEzLWFjZTMtNjg4Yzk3MzI2MTRhLw.json +35 -0
- package/esm/test/mocks/Saml2Api/getProviderByLocationAndId/remote/aWRw.json +83 -0
- package/esm/test/mocks/Saml2Api/getProviderByLocationAndId/remote/dXJuOmZlZGVyYXRpb246TWljcm9zb2Z0T25saW5l.json +1 -3
- package/esm/test/mocks/Saml2Api/getProviderMetadata/alpha/SPAzure.xml +74 -0
- package/esm/test/mocks/Saml2Api/getProviderMetadata/alpha/https%3A%2F%2Fidc.scheuber.io%2Fam%2Fsaml2%2FIDPAzure.xml +78 -0
- package/esm/test/mocks/Saml2Api/getProviderMetadata/alpha/https%3A%2F%2Fidc.scheuber.io%2Fam%2Fsaml2%2FIDPBroadcom.xml +78 -0
- package/esm/test/mocks/Saml2Api/getProviderMetadata/alpha/https%3A%2F%2Fidc.scheuber.io%2Fam%2Fsaml2%2FIDPFedlet.xml +78 -0
- package/esm/test/mocks/Saml2Api/getProviderMetadata/alpha/https%3A%2F%2Fsaml.mytestrun.com%2Fsp.xml +13 -0
- package/esm/test/mocks/Saml2Api/getProviderMetadata/alpha/{dXJuOmZlZGVyYXRpb246TWljcm9zb2Z0T25saW5l.xml → https%3A%2F%2Fsts.windows.net%2F711ffa9c-5972-4713-ace3-688c9732614a%2F.xml} +0 -0
- package/esm/test/mocks/Saml2Api/getProviderMetadata/alpha/{aVNQQXp1cmU.xml → iSPAzure.xml} +0 -0
- package/esm/test/mocks/Saml2Api/getProviderMetadata/alpha/urn%3Afederation%3AMicrosoftOnline.xml +84 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Provider/SPAzure.saml.json +243 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Provider/iSPAzure.saml.json +242 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Provider/idc.scheuber.ioamsaml2IDPAzure.saml.json +454 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Provider/idc.scheuber.ioamsaml2IDPBroadcom.saml.json +586 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Provider/idc.scheuber.ioamsaml2IDPFedlet.saml.json +241 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Provider/idp.saml.json +185 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Provider/saml.mytestrun.comsp.saml.json +101 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Provider/sts.windows.net711ffa9c-5972-4713-ace3-688c9732614a.saml.json +113 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Provider/urn:federation:MicrosoftOnline.saml.json +199 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Provider/volkerDevSP.saml.json +212 -0
- package/esm/test/mocks/Saml2Ops/importSaml2Providers/allAlphaProviders.saml.json +2414 -0
- package/esm/test/mocks/ScriptApi/getScript/5b29c5b7-b161-4a42-a41f-d6c85316b951.json +13 -0
- package/esm/test/mocks/ScriptApi/getScript/85523e71-2d77-4577-b078-6f9674cc54e2.json +13 -0
- package/esm/test/mocks/ScriptApi/getScript/90c4eca5-05f0-42f5-b9bf-88b693eabbbd.json +13 -0
- package/esm/test/mocks/ServerInfoApi/getServerInfo/info.json +25 -0
- package/esm/test/mocks/ServerInfoApi/getServerVersionInfo/version.json +8 -0
- package/esm/utils/AutoSetupPolly.mjs +72 -0
- package/esm/utils/SetupJest.mjs +3 -0
- package/esm/{test/mocks → utils}/snapshotResolve.mjs +10 -12
- package/package.json +38 -27
- package/types/api/AgentApi.d.ts.map +1 -1
- package/types/api/ApiTypes.d.ts +19 -15
- package/types/api/ApiTypes.d.ts.map +1 -1
- package/types/api/AuthenticateApi.d.ts +1 -1
- package/types/api/AuthenticateApi.d.ts.map +1 -1
- package/types/api/BaseApi.d.ts +2 -0
- package/types/api/BaseApi.d.ts.map +1 -1
- package/types/api/CirclesOfTrustApi.d.ts.map +1 -1
- package/types/api/IdmConfigApi.d.ts.map +1 -1
- package/types/api/LogApi.d.ts.map +1 -1
- package/types/api/ManagedObjectApi.d.ts +9 -1
- package/types/api/ManagedObjectApi.d.ts.map +1 -1
- package/types/api/NodeApi.d.ts.map +1 -1
- package/types/api/OAuth2ClientApi.d.ts.map +1 -1
- package/types/api/OAuth2OIDCApi.d.ts +4 -2
- package/types/api/OAuth2OIDCApi.d.ts.map +1 -1
- package/types/api/OAuth2ProviderApi.d.ts.map +1 -1
- package/types/api/RealmApi.d.ts.map +1 -1
- package/types/api/Saml2Api.d.ts +7 -13
- package/types/api/Saml2Api.d.ts.map +1 -1
- package/types/api/ScriptApi.d.ts.map +1 -1
- package/types/api/SecretsApi.d.ts.map +1 -1
- package/types/api/ServerInfoApi.d.ts.map +1 -1
- package/types/api/ServiceApi.d.ts +14 -7
- package/types/api/ServiceApi.d.ts.map +1 -1
- package/types/api/SocialIdentityProvidersApi.d.ts.map +1 -1
- package/types/api/StartupApi.d.ts.map +1 -1
- package/types/api/TreeApi.d.ts.map +1 -1
- package/types/api/VariablesApi.d.ts.map +1 -1
- package/types/api/utils/ApiUtils.d.ts +1 -0
- package/types/api/utils/ApiUtils.d.ts.map +1 -1
- package/types/api/utils/Base64.d.ts +1 -0
- package/types/api/utils/Base64.d.ts.map +1 -1
- package/types/index.d.ts +11 -5
- package/types/index.d.ts.map +1 -1
- package/types/ops/AgentOps.d.ts +1 -1
- package/types/ops/AgentOps.d.ts.map +1 -1
- package/types/ops/AuthenticateOps.d.ts +10 -2
- package/types/ops/AuthenticateOps.d.ts.map +1 -1
- package/types/ops/ConnectionProfileOps.d.ts +49 -21
- package/types/ops/ConnectionProfileOps.d.ts.map +1 -1
- package/types/ops/EmailTemplateOps.d.ts +14 -33
- package/types/ops/EmailTemplateOps.d.ts.map +1 -1
- package/types/ops/IdmOps.d.ts +29 -37
- package/types/ops/IdmOps.d.ts.map +1 -1
- package/types/ops/JoseOps.d.ts +33 -0
- package/types/ops/JoseOps.d.ts.map +1 -0
- package/types/ops/JourneyOps.d.ts.map +1 -1
- package/types/ops/LogOps.d.ts.map +1 -1
- package/types/ops/NodeOps.d.ts.map +1 -1
- package/types/ops/OAuth2ClientOps.d.ts.map +1 -1
- package/types/ops/OpsTypes.d.ts +17 -1
- package/types/ops/OpsTypes.d.ts.map +1 -1
- package/types/ops/OrganizationOps.d.ts.map +1 -1
- package/types/ops/Saml2Ops.d.ts +52 -55
- package/types/ops/Saml2Ops.d.ts.map +1 -1
- package/types/ops/ScriptOps.d.ts.map +1 -1
- package/types/ops/ServiceAccountOps.d.ts +20 -0
- package/types/ops/ServiceAccountOps.d.ts.map +1 -0
- package/types/ops/ServiceOps.d.ts +18 -10
- package/types/ops/ServiceOps.d.ts.map +1 -1
- package/types/ops/ThemeOps.d.ts +35 -50
- package/types/ops/ThemeOps.d.ts.map +1 -1
- package/types/ops/utils/Console.d.ts +1 -1
- package/types/ops/utils/Console.d.ts.map +1 -1
- package/types/ops/utils/DataProtection.d.ts.map +1 -1
- package/types/ops/utils/ExportImportUtils.d.ts +5 -2
- package/types/ops/utils/ExportImportUtils.d.ts.map +1 -1
- package/types/ops/utils/OpsUtils.d.ts +6 -0
- package/types/ops/utils/OpsUtils.d.ts.map +1 -1
- package/types/ops/utils/Wordwrap.d.ts.map +1 -1
- package/types/shared/State.d.ts +223 -0
- package/types/shared/State.d.ts.map +1 -0
- package/types/test/mocks/ForgeRockApiMockEngine.d.ts +21 -1
- package/types/test/mocks/ForgeRockApiMockEngine.d.ts.map +1 -1
- package/types/utils/AutoSetupPolly.d.ts +1 -0
- package/types/utils/AutoSetupPolly.d.ts.map +1 -0
- package/types/utils/SetupJest.d.ts +1 -0
- package/types/utils/SetupJest.d.ts.map +1 -0
- package/types/utils/snapshotResolve.d.ts +1 -0
- package/types/utils/snapshotResolve.d.ts.map +1 -0
- package/cjs/api/EmailTemplateApi.js +0 -73
- package/cjs/api/EmailTemplateApi.js.map +0 -1
- package/cjs/api/ThemeApi.js +0 -367
- package/cjs/api/ThemeApi.js.map +0 -1
- package/cjs/api/ThemeApi.test.js.map +0 -1
- package/cjs/storage/SessionStorage.js +0 -91
- package/cjs/storage/SessionStorage.js.map +0 -1
- package/cjs/test/mocks/snapshotResolve.js.map +0 -1
- package/esm/api/EmailTemplateApi.mjs +0 -34
- package/esm/api/ThemeApi.mjs +0 -271
- package/esm/storage/SessionStorage.mjs +0 -79
- package/types/api/EmailTemplateApi.d.ts +0 -22
- package/types/api/EmailTemplateApi.d.ts.map +0 -1
- package/types/api/ThemeApi.d.ts +0 -56
- package/types/api/ThemeApi.d.ts.map +0 -1
- package/types/storage/SessionStorage.d.ts +0 -71
- package/types/storage/SessionStorage.d.ts.map +0 -1
- package/types/test/mocks/snapshotResolve.d.ts +0 -1
- package/types/test/mocks/snapshotResolve.d.ts.map +0 -1
package/esm/api/BaseApi.mjs
CHANGED
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
import Agent from 'agentkeepalive';
|
|
2
1
|
import axios from 'axios';
|
|
2
|
+
import MockAdapter from 'axios-mock-adapter';
|
|
3
|
+
import Agent from 'agentkeepalive';
|
|
3
4
|
import axiosRetry from 'axios-retry';
|
|
4
5
|
import HttpsProxyAgent from 'https-proxy-agent';
|
|
5
6
|
import url from 'url';
|
|
6
7
|
import fs from 'fs';
|
|
7
|
-
import
|
|
8
|
+
import * as state from '../shared/State';
|
|
8
9
|
import path from 'path';
|
|
9
10
|
import { fileURLToPath } from 'url';
|
|
10
11
|
import { curlirizeMessage, printMessage } from '../ops/utils/Console';
|
|
11
12
|
import _curlirize from '../ext/axios-curlirize/curlirize';
|
|
13
|
+
import { randomUUID } from 'crypto';
|
|
14
|
+
import { mockAll } from '../test/mocks/ForgeRockApiMockEngine';
|
|
12
15
|
|
|
16
|
+
// this has to be the first statement after the imports for mocking to work
|
|
17
|
+
export const FrodoMockAdapter = process.env.FRODO_MOCK || process.env.frodo_mock ? new MockAdapter(axios) : undefined;
|
|
18
|
+
if (FrodoMockAdapter) mockAll(FrodoMockAdapter);
|
|
13
19
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
|
-
|
|
15
20
|
const pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../../package.json'), 'utf8'));
|
|
16
21
|
axiosRetry(axios, {
|
|
17
22
|
retries: 3,
|
|
18
23
|
shouldResetTimeout: true,
|
|
19
24
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
25
|
retryCondition: _error => true // retry no matter what
|
|
26
|
+
});
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const timeout = 30000; // agentkeepalive
|
|
28
|
+
// all agents
|
|
29
|
+
const timeout = 30000;
|
|
25
30
|
|
|
31
|
+
// agentkeepalive
|
|
26
32
|
const maxSockets = 100;
|
|
27
33
|
const maxFreeSockets = 10;
|
|
28
34
|
const freeSocketTimeout = 30000;
|
|
29
35
|
const userAgent = `${pkg.name}/${pkg.version}`;
|
|
36
|
+
const transactionId = `frodo-${randomUUID()}`;
|
|
30
37
|
let httpAgent, httpsAgent;
|
|
31
|
-
|
|
32
38
|
function getHttpAgent() {
|
|
33
39
|
if (httpAgent) return httpAgent;
|
|
34
40
|
httpAgent = new Agent({
|
|
@@ -39,19 +45,17 @@ function getHttpAgent() {
|
|
|
39
45
|
});
|
|
40
46
|
return httpAgent;
|
|
41
47
|
}
|
|
48
|
+
|
|
42
49
|
/**
|
|
43
50
|
* Helper method to create properly configured httpsAgent
|
|
44
51
|
* @returns {any} appropriate httpsAgent
|
|
45
52
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
53
|
function getHttpsAgent() {
|
|
49
54
|
if (httpsAgent) return httpsAgent;
|
|
50
55
|
const options = {
|
|
51
|
-
rejectUnauthorized: !
|
|
56
|
+
rejectUnauthorized: !state.getAllowInsecureConnection()
|
|
52
57
|
};
|
|
53
58
|
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
|
|
54
|
-
|
|
55
59
|
if (httpsProxy) {
|
|
56
60
|
// https://github.com/axios/axios/issues/3459
|
|
57
61
|
console.error(`Using proxy ${httpsProxy}`['yellow']);
|
|
@@ -59,12 +63,12 @@ function getHttpsAgent() {
|
|
|
59
63
|
options['host'] = parsed.hostname;
|
|
60
64
|
options['port'] = parsed.port;
|
|
61
65
|
options['protocol'] = parsed.protocol;
|
|
62
|
-
options.rejectUnauthorized = !
|
|
66
|
+
options.rejectUnauthorized = !state.getAllowInsecureConnection();
|
|
63
67
|
httpsAgent = HttpsProxyAgent(options);
|
|
64
68
|
return httpsAgent;
|
|
65
69
|
}
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
httpsAgent = new Agent.HttpsAgent({
|
|
71
|
+
...options,
|
|
68
72
|
maxSockets,
|
|
69
73
|
maxFreeSockets,
|
|
70
74
|
timeout,
|
|
@@ -72,28 +76,25 @@ function getHttpsAgent() {
|
|
|
72
76
|
});
|
|
73
77
|
return httpsAgent;
|
|
74
78
|
}
|
|
79
|
+
|
|
75
80
|
/**
|
|
76
81
|
* Get Proxy config
|
|
77
82
|
* @returns {AxiosProxyConfig | false} axios proxy config or false
|
|
78
83
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
84
|
function getProxy() {
|
|
82
85
|
if (process.env.HTTPS_PROXY || process.env.https_proxy) return false;
|
|
83
86
|
return null;
|
|
84
87
|
}
|
|
88
|
+
|
|
85
89
|
/**
|
|
86
90
|
* Customize curlirize output
|
|
87
91
|
* @param request axios request object
|
|
88
92
|
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
93
|
function curlirize(request) {
|
|
92
94
|
_curlirize(request, (result, err) => {
|
|
93
95
|
const {
|
|
94
96
|
command
|
|
95
97
|
} = result;
|
|
96
|
-
|
|
97
98
|
if (err) {
|
|
98
99
|
printMessage(err, 'error');
|
|
99
100
|
} else {
|
|
@@ -101,6 +102,7 @@ function curlirize(request) {
|
|
|
101
102
|
}
|
|
102
103
|
});
|
|
103
104
|
}
|
|
105
|
+
|
|
104
106
|
/**
|
|
105
107
|
* Generates an AM Axios API instance
|
|
106
108
|
* @param {object} resource Takes an object takes a resource object. example:
|
|
@@ -109,47 +111,51 @@ function curlirize(request) {
|
|
|
109
111
|
*
|
|
110
112
|
* @returns {AxiosInstance}
|
|
111
113
|
*/
|
|
112
|
-
|
|
113
|
-
|
|
114
114
|
export function generateAmApi(resource, requestOverride = {}) {
|
|
115
115
|
let headers = {
|
|
116
116
|
'User-Agent': userAgent,
|
|
117
|
+
'X-ForgeRock-TransactionId': transactionId,
|
|
117
118
|
'Content-Type': 'application/json',
|
|
118
119
|
// only add API version if we have it
|
|
119
120
|
...(resource.apiVersion && {
|
|
120
121
|
'Accept-API-Version': resource.apiVersion
|
|
121
122
|
}),
|
|
122
|
-
// only send session cookie if we know its name and value
|
|
123
|
-
...(
|
|
124
|
-
Cookie: `${
|
|
123
|
+
// only send session cookie if we know its name and value and we are not instructed to use the bearer token for AM APIs
|
|
124
|
+
...(!state.getUseBearerTokenForAmApis() && state.getCookieName() && state.getCookieValue() && {
|
|
125
|
+
Cookie: `${state.getCookieName()}=${state.getCookieValue()}`
|
|
126
|
+
}),
|
|
127
|
+
// only add authorization header if we have a bearer token and are instructed to use it for AM APIs
|
|
128
|
+
...(state.getUseBearerTokenForAmApis() && state.getBearerToken() && {
|
|
129
|
+
Authorization: `Bearer ${state.getBearerToken()}`
|
|
125
130
|
})
|
|
126
131
|
};
|
|
127
|
-
|
|
128
132
|
if (requestOverride['headers']) {
|
|
129
|
-
headers = {
|
|
133
|
+
headers = {
|
|
134
|
+
...headers,
|
|
130
135
|
...requestOverride['headers']
|
|
131
136
|
};
|
|
132
137
|
}
|
|
133
|
-
|
|
134
138
|
const requestDetails = {
|
|
135
139
|
// baseURL: `${storage.session.getTenant()}/json`,
|
|
136
140
|
timeout,
|
|
137
141
|
...requestOverride,
|
|
138
|
-
headers: {
|
|
139
|
-
...
|
|
142
|
+
headers: {
|
|
143
|
+
...headers,
|
|
144
|
+
...state.getAuthenticationHeaderOverrides()
|
|
140
145
|
},
|
|
141
146
|
httpAgent: getHttpAgent(),
|
|
142
147
|
httpsAgent: getHttpsAgent(),
|
|
143
148
|
proxy: getProxy()
|
|
144
149
|
};
|
|
145
|
-
const request = axios.create(requestDetails);
|
|
150
|
+
const request = axios.create(requestDetails);
|
|
146
151
|
|
|
147
|
-
|
|
152
|
+
// enable curlirizer output in debug mode
|
|
153
|
+
if (state.getCurlirize()) {
|
|
148
154
|
curlirize(request);
|
|
149
155
|
}
|
|
150
|
-
|
|
151
156
|
return request;
|
|
152
157
|
}
|
|
158
|
+
|
|
153
159
|
/**
|
|
154
160
|
* Generates an OAuth2 Axios API instance
|
|
155
161
|
* @param {object} resource Takes an object takes a resource object. example:
|
|
@@ -158,45 +164,50 @@ export function generateAmApi(resource, requestOverride = {}) {
|
|
|
158
164
|
*
|
|
159
165
|
* @returns {AxiosInstance}
|
|
160
166
|
*/
|
|
161
|
-
|
|
162
167
|
export function generateOauth2Api(resource, requestOverride = {}) {
|
|
163
168
|
let headers = {
|
|
164
169
|
'User-Agent': userAgent,
|
|
170
|
+
'X-ForgeRock-TransactionId': transactionId,
|
|
165
171
|
// only add API version if we have it
|
|
166
172
|
...(resource.apiVersion && {
|
|
167
173
|
'Accept-API-Version': resource.apiVersion
|
|
168
174
|
}),
|
|
169
|
-
// only send session cookie if we know its name and value
|
|
170
|
-
...(
|
|
171
|
-
Cookie: `${
|
|
175
|
+
// only send session cookie if we know its name and value and we are not instructed to use the bearer token for AM APIs
|
|
176
|
+
...(!state.getUseBearerTokenForAmApis() && state.getCookieName() && state.getCookieValue() && {
|
|
177
|
+
Cookie: `${state.getCookieName()}=${state.getCookieValue()}`
|
|
178
|
+
}),
|
|
179
|
+
// only add authorization header if we have a bearer token and are instructed to use it for AM APIs
|
|
180
|
+
...(state.getUseBearerTokenForAmApis() && state.getBearerToken() && {
|
|
181
|
+
Authorization: `Bearer ${state.getBearerToken()}`
|
|
172
182
|
})
|
|
173
183
|
};
|
|
174
|
-
|
|
175
184
|
if (requestOverride['headers']) {
|
|
176
|
-
headers = {
|
|
185
|
+
headers = {
|
|
186
|
+
...headers,
|
|
177
187
|
...requestOverride['headers']
|
|
178
188
|
};
|
|
179
189
|
}
|
|
180
|
-
|
|
181
190
|
const requestDetails = {
|
|
182
191
|
// baseURL: `${storage.session.getTenant()}/json${resource.path}`,
|
|
183
192
|
timeout,
|
|
184
193
|
...requestOverride,
|
|
185
|
-
headers: {
|
|
186
|
-
...
|
|
194
|
+
headers: {
|
|
195
|
+
...headers,
|
|
196
|
+
...state.getAuthenticationHeaderOverrides()
|
|
187
197
|
},
|
|
188
198
|
httpAgent: getHttpAgent(),
|
|
189
199
|
httpsAgent: getHttpsAgent(),
|
|
190
200
|
proxy: getProxy()
|
|
191
201
|
};
|
|
192
|
-
const request = axios.create(requestDetails);
|
|
202
|
+
const request = axios.create(requestDetails);
|
|
193
203
|
|
|
194
|
-
|
|
204
|
+
// enable curlirizer output in debug mode
|
|
205
|
+
if (state.getCurlirize()) {
|
|
195
206
|
curlirize(request);
|
|
196
207
|
}
|
|
197
|
-
|
|
198
208
|
return request;
|
|
199
209
|
}
|
|
210
|
+
|
|
200
211
|
/**
|
|
201
212
|
* Generates an IDM Axios API instance
|
|
202
213
|
* @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add
|
|
@@ -204,14 +215,18 @@ export function generateOauth2Api(resource, requestOverride = {}) {
|
|
|
204
215
|
*
|
|
205
216
|
* @returns {AxiosInstance}
|
|
206
217
|
*/
|
|
207
|
-
|
|
208
218
|
export function generateIdmApi(requestOverride = {}) {
|
|
209
219
|
const requestDetails = {
|
|
210
220
|
// baseURL: getTenantURL(storage.session.getTenant()),
|
|
211
221
|
timeout,
|
|
212
222
|
headers: {
|
|
213
223
|
'User-Agent': userAgent,
|
|
214
|
-
'
|
|
224
|
+
'X-ForgeRock-TransactionId': transactionId,
|
|
225
|
+
'Content-Type': 'application/json',
|
|
226
|
+
// only add authorization header if we have a bearer token
|
|
227
|
+
...(state.getBearerToken() && {
|
|
228
|
+
Authorization: `Bearer ${state.getBearerToken()}`
|
|
229
|
+
})
|
|
215
230
|
},
|
|
216
231
|
...requestOverride,
|
|
217
232
|
httpAgent: getHttpAgent(),
|
|
@@ -219,18 +234,21 @@ export function generateIdmApi(requestOverride = {}) {
|
|
|
219
234
|
proxy: getProxy()
|
|
220
235
|
};
|
|
221
236
|
|
|
222
|
-
if (storage.session.getBearerToken()) {
|
|
223
|
-
|
|
224
|
-
|
|
237
|
+
// if (storage.session.getBearerToken()) {
|
|
238
|
+
// requestDetails.headers[
|
|
239
|
+
// 'Authorization'
|
|
240
|
+
// ] = `Bearer ${storage.session.getBearerToken()}`;
|
|
241
|
+
// }
|
|
225
242
|
|
|
226
|
-
const request = axios.create(requestDetails);
|
|
243
|
+
const request = axios.create(requestDetails);
|
|
227
244
|
|
|
228
|
-
|
|
245
|
+
// enable curlirizer output in debug mode
|
|
246
|
+
if (state.getCurlirize()) {
|
|
229
247
|
curlirize(request);
|
|
230
248
|
}
|
|
231
|
-
|
|
232
249
|
return request;
|
|
233
250
|
}
|
|
251
|
+
|
|
234
252
|
/**
|
|
235
253
|
* Generates a LogKeys API Axios instance
|
|
236
254
|
* @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add
|
|
@@ -238,11 +256,14 @@ export function generateIdmApi(requestOverride = {}) {
|
|
|
238
256
|
*
|
|
239
257
|
* @returns {AxiosInstance}
|
|
240
258
|
*/
|
|
241
|
-
|
|
242
259
|
export function generateLogKeysApi(requestOverride = {}) {
|
|
243
260
|
const headers = {
|
|
244
261
|
'User-Agent': userAgent,
|
|
245
|
-
'Content-Type': 'application/json'
|
|
262
|
+
'Content-Type': 'application/json',
|
|
263
|
+
// only add authorization header if we have a bearer token
|
|
264
|
+
...(state.getBearerToken() && {
|
|
265
|
+
Authorization: `Bearer ${state.getBearerToken()}`
|
|
266
|
+
})
|
|
246
267
|
};
|
|
247
268
|
const requestDetails = {
|
|
248
269
|
// baseURL: getTenantURL(storage.session.getTenant()),
|
|
@@ -253,19 +274,15 @@ export function generateLogKeysApi(requestOverride = {}) {
|
|
|
253
274
|
httpsAgent: getHttpsAgent(),
|
|
254
275
|
proxy: getProxy()
|
|
255
276
|
};
|
|
277
|
+
const request = axios.create(requestDetails);
|
|
256
278
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
const request = axios.create(requestDetails); // enable curlirizer output in debug mode
|
|
262
|
-
|
|
263
|
-
if (storage.session.getCurlirize()) {
|
|
279
|
+
// enable curlirizer output in debug mode
|
|
280
|
+
if (state.getCurlirize()) {
|
|
264
281
|
curlirize(request);
|
|
265
282
|
}
|
|
266
|
-
|
|
267
283
|
return request;
|
|
268
284
|
}
|
|
285
|
+
|
|
269
286
|
/**
|
|
270
287
|
* Generates a Log API Axios instance
|
|
271
288
|
* @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add
|
|
@@ -273,12 +290,11 @@ export function generateLogKeysApi(requestOverride = {}) {
|
|
|
273
290
|
*
|
|
274
291
|
* @returns {AxiosInstance}
|
|
275
292
|
*/
|
|
276
|
-
|
|
277
293
|
export function generateLogApi(requestOverride = {}) {
|
|
278
294
|
const headers = {
|
|
279
295
|
'User-Agent': userAgent,
|
|
280
|
-
'X-API-Key':
|
|
281
|
-
'X-API-Secret':
|
|
296
|
+
'X-API-Key': state.getLogApiKey(),
|
|
297
|
+
'X-API-Secret': state.getLogApiSecret()
|
|
282
298
|
};
|
|
283
299
|
const requestDetails = {
|
|
284
300
|
// baseURL: getTenantURL(storage.session.getTenant()),
|
|
@@ -289,14 +305,15 @@ export function generateLogApi(requestOverride = {}) {
|
|
|
289
305
|
httpsAgent: getHttpsAgent(),
|
|
290
306
|
proxy: getProxy()
|
|
291
307
|
};
|
|
292
|
-
const request = axios.create(requestDetails);
|
|
308
|
+
const request = axios.create(requestDetails);
|
|
293
309
|
|
|
294
|
-
|
|
310
|
+
// enable curlirizer output in debug mode
|
|
311
|
+
if (state.getCurlirize()) {
|
|
295
312
|
curlirize(request);
|
|
296
313
|
}
|
|
297
|
-
|
|
298
314
|
return request;
|
|
299
315
|
}
|
|
316
|
+
|
|
300
317
|
/**
|
|
301
318
|
* Generates an ESV Axios API instance for Environment Secrets and Variables
|
|
302
319
|
* @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add
|
|
@@ -304,7 +321,6 @@ export function generateLogApi(requestOverride = {}) {
|
|
|
304
321
|
*
|
|
305
322
|
* @returns {AxiosInstance}
|
|
306
323
|
*/
|
|
307
|
-
|
|
308
324
|
export function generateESVApi(resource, requestOverride = {}) {
|
|
309
325
|
const headers = {
|
|
310
326
|
'User-Agent': userAgent,
|
|
@@ -312,6 +328,10 @@ export function generateESVApi(resource, requestOverride = {}) {
|
|
|
312
328
|
// only add API version if we have it
|
|
313
329
|
...(resource.apiVersion && {
|
|
314
330
|
'Accept-API-Version': resource.apiVersion
|
|
331
|
+
}),
|
|
332
|
+
// only add authorization header if we have a bearer token
|
|
333
|
+
...(state.getBearerToken() && {
|
|
334
|
+
Authorization: `Bearer ${state.getBearerToken()}`
|
|
315
335
|
})
|
|
316
336
|
};
|
|
317
337
|
const requestDetails = {
|
|
@@ -323,19 +343,15 @@ export function generateESVApi(resource, requestOverride = {}) {
|
|
|
323
343
|
httpsAgent: getHttpsAgent(),
|
|
324
344
|
proxy: getProxy()
|
|
325
345
|
};
|
|
346
|
+
const request = axios.create(requestDetails);
|
|
326
347
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
const request = axios.create(requestDetails); // enable curlirizer output in debug mode
|
|
332
|
-
|
|
333
|
-
if (storage.session.getCurlirize()) {
|
|
348
|
+
// enable curlirizer output in debug mode
|
|
349
|
+
if (state.getCurlirize()) {
|
|
334
350
|
curlirize(request);
|
|
335
351
|
}
|
|
336
|
-
|
|
337
352
|
return request;
|
|
338
353
|
}
|
|
354
|
+
|
|
339
355
|
/**
|
|
340
356
|
* Generates a release (Github or Npm) Axios API instance
|
|
341
357
|
* @param {object} requestOverride Takes an object of AXIOS parameters that can be used to either add
|
|
@@ -343,7 +359,6 @@ export function generateESVApi(resource, requestOverride = {}) {
|
|
|
343
359
|
*
|
|
344
360
|
* @returns {AxiosInstance}
|
|
345
361
|
*/
|
|
346
|
-
|
|
347
362
|
export function generateReleaseApi(baseUrl, requestOverride = {}) {
|
|
348
363
|
const requestDetails = {
|
|
349
364
|
baseURL: baseUrl,
|
|
@@ -357,12 +372,12 @@ export function generateReleaseApi(baseUrl, requestOverride = {}) {
|
|
|
357
372
|
httpsAgent: getHttpsAgent(),
|
|
358
373
|
proxy: getProxy()
|
|
359
374
|
};
|
|
360
|
-
const request = axios.create(requestDetails);
|
|
375
|
+
const request = axios.create(requestDetails);
|
|
361
376
|
|
|
362
|
-
|
|
377
|
+
// enable curlirizer output in debug mode
|
|
378
|
+
if (state.getCurlirize()) {
|
|
363
379
|
curlirize(request);
|
|
364
380
|
}
|
|
365
|
-
|
|
366
381
|
return request;
|
|
367
382
|
}
|
|
368
383
|
//# sourceMappingURL=BaseApi.js.map
|
|
@@ -2,26 +2,24 @@ import util from 'util';
|
|
|
2
2
|
import _ from 'lodash';
|
|
3
3
|
import { generateAmApi } from './BaseApi';
|
|
4
4
|
import { getCurrentRealmPath } from './utils/ApiUtils';
|
|
5
|
-
import
|
|
5
|
+
import * as state from '../shared/State';
|
|
6
6
|
const circleOfTrustByIdURLTemplate = '%s/json%s/realm-config/federation/circlesoftrust/%s';
|
|
7
7
|
const createCircleOfTrustURLTemplate = '%s/json%s/realm-config/federation/circlesoftrust/?_action=create';
|
|
8
8
|
const queryAllCirclesOfTrustURLTemplate = '%s/json%s/realm-config/federation/circlesoftrust?_queryFilter=true';
|
|
9
9
|
const apiVersion = 'protocol=2.1,resource=1.0';
|
|
10
|
-
|
|
11
10
|
const getApiConfig = () => {
|
|
12
11
|
return {
|
|
13
12
|
path: `/json${getCurrentRealmPath()}/realm-config/federation/circlesoftrust`,
|
|
14
13
|
apiVersion
|
|
15
14
|
};
|
|
16
15
|
};
|
|
16
|
+
|
|
17
17
|
/**
|
|
18
18
|
* Get all SAML2 circles of trust
|
|
19
19
|
* @returns {Promise} a promise that resolves to an array of circles of trust objects
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
21
|
export async function getCirclesOfTrust() {
|
|
24
|
-
const urlString = util.format(queryAllCirclesOfTrustURLTemplate,
|
|
22
|
+
const urlString = util.format(queryAllCirclesOfTrustURLTemplate, state.getHost(), getCurrentRealmPath());
|
|
25
23
|
const {
|
|
26
24
|
data
|
|
27
25
|
} = await generateAmApi(getApiConfig()).get(urlString, {
|
|
@@ -29,14 +27,14 @@ export async function getCirclesOfTrust() {
|
|
|
29
27
|
});
|
|
30
28
|
return data;
|
|
31
29
|
}
|
|
30
|
+
|
|
32
31
|
/**
|
|
33
32
|
* Get SAML2 circle of trust by id/name
|
|
34
33
|
* @param {String} cotId Circle of trust id/name
|
|
35
34
|
* @returns {Promise} a promise that resolves to a saml2 circle of trust object
|
|
36
35
|
*/
|
|
37
|
-
|
|
38
36
|
export async function getCircleOfTrust(cotId) {
|
|
39
|
-
const urlString = util.format(circleOfTrustByIdURLTemplate,
|
|
37
|
+
const urlString = util.format(circleOfTrustByIdURLTemplate, state.getHost(), getCurrentRealmPath(), cotId);
|
|
40
38
|
const {
|
|
41
39
|
data
|
|
42
40
|
} = await generateAmApi(getApiConfig()).get(urlString, {
|
|
@@ -44,16 +42,15 @@ export async function getCircleOfTrust(cotId) {
|
|
|
44
42
|
});
|
|
45
43
|
return data;
|
|
46
44
|
}
|
|
45
|
+
|
|
47
46
|
/**
|
|
48
47
|
* Create a SAML2 circle of trust
|
|
49
48
|
* @param {Object} cotData Object representing a SAML circle of trust
|
|
50
49
|
* @returns {Promise} a promise that resolves to a saml2 circle of trust object
|
|
51
50
|
*/
|
|
52
|
-
|
|
53
51
|
export async function createCircleOfTrust(cotData) {
|
|
54
52
|
const postData = _.cloneDeep(cotData);
|
|
55
|
-
|
|
56
|
-
const urlString = util.format(createCircleOfTrustURLTemplate, storage.session.getTenant(), getCurrentRealmPath());
|
|
53
|
+
const urlString = util.format(createCircleOfTrustURLTemplate, state.getHost(), getCurrentRealmPath());
|
|
57
54
|
const {
|
|
58
55
|
data
|
|
59
56
|
} = await generateAmApi(getApiConfig()).post(urlString, postData, {
|
|
@@ -61,15 +58,15 @@ export async function createCircleOfTrust(cotData) {
|
|
|
61
58
|
});
|
|
62
59
|
return data;
|
|
63
60
|
}
|
|
61
|
+
|
|
64
62
|
/**
|
|
65
63
|
* Update SAML2 circle of trust
|
|
66
64
|
* @param {String} cotId Entity provider location (hosted or remote)
|
|
67
65
|
* @param {Object} cotData Object representing a SAML2 circle of trust
|
|
68
66
|
* @returns {Promise} a promise that resolves to a saml2 circle of trust object
|
|
69
67
|
*/
|
|
70
|
-
|
|
71
68
|
export async function updateCircleOfTrust(cotId, cotData) {
|
|
72
|
-
const urlString = util.format(circleOfTrustByIdURLTemplate,
|
|
69
|
+
const urlString = util.format(circleOfTrustByIdURLTemplate, state.getHost(), getCurrentRealmPath(), cotId);
|
|
73
70
|
const {
|
|
74
71
|
data
|
|
75
72
|
} = await generateAmApi(getApiConfig()).put(urlString, cotData, {
|
package/esm/api/IdmConfigApi.mjs
CHANGED
|
@@ -1,59 +1,58 @@
|
|
|
1
1
|
import util from 'util';
|
|
2
2
|
import { generateIdmApi } from './BaseApi';
|
|
3
3
|
import { getTenantURL } from './utils/ApiUtils';
|
|
4
|
-
import
|
|
4
|
+
import * as state from '../shared/State';
|
|
5
5
|
const idmAllConfigURLTemplate = '%s/openidm/config';
|
|
6
6
|
const idmConfigURLTemplate = '%s/openidm/config/%s';
|
|
7
7
|
const idmConfigEntityQueryTemplate = '%s/openidm/config?_queryFilter=%s';
|
|
8
8
|
const idmManagedObjectURLTemplate = '%s/openidm/managed/%s?_queryFilter=true&_pageSize=10000';
|
|
9
|
+
|
|
9
10
|
/**
|
|
10
11
|
* Get all IDM config entities
|
|
11
12
|
* @returns {Promise} a promise that resolves to all IDM config entities
|
|
12
13
|
*/
|
|
13
|
-
|
|
14
14
|
export async function getAllConfigEntities() {
|
|
15
|
-
const urlString = util.format(idmAllConfigURLTemplate, getTenantURL(
|
|
15
|
+
const urlString = util.format(idmAllConfigURLTemplate, getTenantURL(state.getHost()));
|
|
16
16
|
const {
|
|
17
17
|
data
|
|
18
18
|
} = await generateIdmApi().get(urlString);
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
+
|
|
21
22
|
/**
|
|
22
23
|
* Get IDM config entities by type
|
|
23
24
|
* @param {String} type the desired type of config entity
|
|
24
25
|
* @returns {Promise} a promise that resolves to an object containing all IDM config entities of the desired type
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
27
|
export async function getConfigEntitiesByType(type) {
|
|
28
|
-
const urlString = util.format(idmConfigEntityQueryTemplate, getTenantURL(
|
|
28
|
+
const urlString = util.format(idmConfigEntityQueryTemplate, getTenantURL(state.getHost()), encodeURIComponent(`_id sw '${type}'`));
|
|
29
29
|
const {
|
|
30
30
|
data
|
|
31
31
|
} = await generateIdmApi().get(urlString);
|
|
32
32
|
return data;
|
|
33
33
|
}
|
|
34
|
+
|
|
34
35
|
/**
|
|
35
36
|
* Get an IDM config entity
|
|
36
37
|
* @param {string} entityId the desired config entity
|
|
37
38
|
* @returns {Promise<unknown>} a promise that resolves to an IDM config entity
|
|
38
39
|
*/
|
|
39
|
-
|
|
40
40
|
export async function getConfigEntity(entityId) {
|
|
41
|
-
const urlString = util.format(idmConfigURLTemplate, getTenantURL(
|
|
41
|
+
const urlString = util.format(idmConfigURLTemplate, getTenantURL(state.getHost()), entityId);
|
|
42
42
|
const {
|
|
43
43
|
data
|
|
44
44
|
} = await generateIdmApi().get(urlString);
|
|
45
45
|
return data;
|
|
46
46
|
}
|
|
47
|
+
|
|
47
48
|
/**
|
|
48
49
|
* Put IDM config entity
|
|
49
50
|
* @param {string} entityId config entity id
|
|
50
51
|
* @param {string} entityData config entity object
|
|
51
52
|
* @returns {Promise<unknown>} a promise that resolves to an IDM config entity
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
54
|
export async function putConfigEntity(entityId, entityData) {
|
|
55
|
-
const urlString = util.format(idmConfigURLTemplate, getTenantURL(
|
|
56
|
-
|
|
55
|
+
const urlString = util.format(idmConfigURLTemplate, getTenantURL(state.getHost()), entityId);
|
|
57
56
|
try {
|
|
58
57
|
const {
|
|
59
58
|
data
|
|
@@ -63,6 +62,7 @@ export async function putConfigEntity(entityId, entityData) {
|
|
|
63
62
|
throw Error(`Could not put config entity ${entityId}: ${error}`);
|
|
64
63
|
}
|
|
65
64
|
}
|
|
65
|
+
|
|
66
66
|
/**
|
|
67
67
|
* Query managed objects
|
|
68
68
|
* @param {String} type managed object type
|
|
@@ -70,11 +70,10 @@ export async function putConfigEntity(entityId, entityData) {
|
|
|
70
70
|
* @param {String} pageCookie paged results cookie
|
|
71
71
|
* @returns {Promise<{result: any[]; resultCount: number; pagedResultsCookie: any; totalPagedResultsPolicy: string; totalPagedResults: number; remainingPagedResults: number;}>} a promise that resolves to managed objects of the desired type
|
|
72
72
|
*/
|
|
73
|
-
|
|
74
73
|
export async function queryAllManagedObjectsByType(type, fields, pageCookie) {
|
|
75
74
|
const fieldsParam = fields.length > 0 ? `&_fields=${fields.join(',')}` : '&_fields=_id';
|
|
76
75
|
const urlTemplate = pageCookie ? `${idmManagedObjectURLTemplate}${fieldsParam}&_pagedResultsCookie=${encodeURIComponent(pageCookie)}` : `${idmManagedObjectURLTemplate}${fieldsParam}`;
|
|
77
|
-
const urlString = util.format(urlTemplate, getTenantURL(
|
|
76
|
+
const urlString = util.format(urlTemplate, getTenantURL(state.getHost()), type);
|
|
78
77
|
const {
|
|
79
78
|
data
|
|
80
79
|
} = await generateIdmApi().get(urlString);
|
package/esm/api/LogApi.mjs
CHANGED
|
@@ -1,42 +1,38 @@
|
|
|
1
1
|
import util from 'util';
|
|
2
2
|
import { generateLogApi, generateLogKeysApi } from './BaseApi';
|
|
3
3
|
import { getTenantURL } from './utils/ApiUtils';
|
|
4
|
-
import
|
|
4
|
+
import * as state from '../shared/State';
|
|
5
5
|
const logsTailURLTemplate = '%s/monitoring/logs/tail?source=%s';
|
|
6
6
|
const logsFetchURLTemplate = '%s/monitoring/logs?source=%s&beginTime=%s&endTime=%s';
|
|
7
7
|
const logsSourcesURLTemplate = '%s/monitoring/logs/sources';
|
|
8
8
|
const logsCreateAPIKeyAndSecretURLTemplate = '%s/keys?_action=create';
|
|
9
9
|
const logsGetAPIKeysURLTemplate = '%s/keys';
|
|
10
10
|
export async function tail(source, cookie) {
|
|
11
|
-
let urlString = util.format(logsTailURLTemplate, getTenantURL(
|
|
12
|
-
|
|
11
|
+
let urlString = util.format(logsTailURLTemplate, getTenantURL(state.getHost()), encodeURIComponent(source));
|
|
13
12
|
if (cookie) {
|
|
14
13
|
urlString += `&_pagedResultsCookie=${encodeURIComponent(cookie)}`;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
return generateLogApi().get(urlString);
|
|
18
16
|
}
|
|
19
17
|
export async function getAPIKeys() {
|
|
20
|
-
const urlString = util.format(logsGetAPIKeysURLTemplate, getTenantURL(
|
|
18
|
+
const urlString = util.format(logsGetAPIKeysURLTemplate, getTenantURL(state.getHost()));
|
|
21
19
|
return generateLogKeysApi().get(urlString);
|
|
22
20
|
}
|
|
23
21
|
export async function getSources() {
|
|
24
|
-
const urlString = util.format(logsSourcesURLTemplate, getTenantURL(
|
|
22
|
+
const urlString = util.format(logsSourcesURLTemplate, getTenantURL(state.getHost()));
|
|
25
23
|
return generateLogApi().get(urlString);
|
|
26
24
|
}
|
|
27
25
|
export async function createAPIKeyAndSecret(keyName) {
|
|
28
|
-
const urlString = util.format(logsCreateAPIKeyAndSecretURLTemplate, getTenantURL(
|
|
26
|
+
const urlString = util.format(logsCreateAPIKeyAndSecretURLTemplate, getTenantURL(state.getHost()));
|
|
29
27
|
return generateLogKeysApi().post(urlString, {
|
|
30
28
|
name: keyName
|
|
31
29
|
});
|
|
32
30
|
}
|
|
33
31
|
export async function fetch(source, startTs, endTs, cookie) {
|
|
34
|
-
let urlString = util.format(logsFetchURLTemplate, getTenantURL(
|
|
35
|
-
|
|
32
|
+
let urlString = util.format(logsFetchURLTemplate, getTenantURL(state.getHost()), encodeURIComponent(source), startTs, endTs);
|
|
36
33
|
if (cookie) {
|
|
37
34
|
urlString += `&_pagedResultsCookie=${encodeURIComponent(cookie)}`;
|
|
38
35
|
}
|
|
39
|
-
|
|
40
36
|
return generateLogApi({
|
|
41
37
|
timeout: 60000
|
|
42
38
|
}).get(urlString);
|