@rockcarver/frodo-lib 1.0.0 → 2.0.0-2
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 +6 -6
- package/cjs/api/AgentApi.js +91 -37
- package/cjs/api/AgentApi.js.map +1 -1
- package/cjs/api/AgentApi.test.js.map +1 -1
- package/cjs/api/ApiTypes.js.map +1 -1
- package/cjs/api/AuthenticateApi.js +18 -11
- package/cjs/api/AuthenticateApi.js.map +1 -1
- package/cjs/api/AuthenticateApi.test.js.map +1 -1
- package/cjs/api/BaseApi.js +50 -26
- package/cjs/api/BaseApi.js.map +1 -1
- package/cjs/api/CirclesOfTrustApi.js +47 -23
- package/cjs/api/CirclesOfTrustApi.js.map +1 -1
- package/cjs/api/IdmConfigApi.js +54 -21
- package/cjs/api/IdmConfigApi.js.map +1 -1
- package/cjs/api/IdmSystemApi.js +9 -6
- package/cjs/api/IdmSystemApi.js.map +1 -1
- package/cjs/api/ManagedObjectApi.js +49 -27
- package/cjs/api/ManagedObjectApi.js.map +1 -1
- package/cjs/api/NodeApi.js +71 -32
- package/cjs/api/NodeApi.js.map +1 -1
- package/cjs/api/NodeApi.test.js.map +1 -1
- package/cjs/api/OAuth2ClientApi.js +43 -20
- package/cjs/api/OAuth2ClientApi.js.map +1 -1
- package/cjs/api/OAuth2OIDCApi.js +74 -27
- package/cjs/api/OAuth2OIDCApi.js.map +1 -1
- package/cjs/api/OAuth2OIDCApi.test.js.map +1 -1
- package/cjs/api/OAuth2ProviderApi.js +10 -9
- package/cjs/api/OAuth2ProviderApi.js.map +1 -1
- package/cjs/api/PoliciesApi.js +54 -22
- package/cjs/api/PoliciesApi.js.map +1 -1
- package/cjs/api/PoliciesApi.test.js.map +1 -1
- package/cjs/api/PolicySetApi.js +54 -23
- package/cjs/api/PolicySetApi.js.map +1 -1
- package/cjs/api/PolicySetApi.test.js.map +1 -1
- package/cjs/api/RealmApi.js +73 -29
- package/cjs/api/RealmApi.js.map +1 -1
- package/cjs/api/ResourceTypesApi.js +67 -28
- package/cjs/api/ResourceTypesApi.js.map +1 -1
- package/cjs/api/ResourceTypesApi.test.js.map +1 -1
- package/cjs/api/Saml2Api.js +90 -122
- package/cjs/api/Saml2Api.js.map +1 -1
- package/cjs/api/ScriptApi.js +54 -23
- package/cjs/api/ScriptApi.js.map +1 -1
- package/cjs/api/ServerInfoApi.js +23 -10
- package/cjs/api/ServerInfoApi.js.map +1 -1
- package/cjs/api/ServiceApi.js +91 -42
- package/cjs/api/ServiceApi.js.map +1 -1
- package/cjs/api/SocialIdentityProvidersApi.js +70 -31
- package/cjs/api/SocialIdentityProvidersApi.js.map +1 -1
- package/cjs/api/TreeApi.js +43 -20
- package/cjs/api/TreeApi.js.map +1 -1
- package/cjs/api/TreeApi.test.js.map +1 -1
- package/cjs/api/cloud/EnvInfoApi.js +10 -6
- package/cjs/api/cloud/EnvInfoApi.js.map +1 -1
- package/cjs/api/cloud/FeatureApi.js +9 -6
- package/cjs/api/cloud/FeatureApi.js.map +1 -1
- package/cjs/api/cloud/LogApi.js +48 -18
- package/cjs/api/cloud/LogApi.js.map +1 -1
- package/cjs/api/cloud/SecretsApi.js +109 -35
- package/cjs/api/cloud/SecretsApi.js.map +1 -1
- package/cjs/api/cloud/SecretsApi.test.js.map +1 -1
- package/cjs/api/cloud/StartupApi.js +21 -10
- package/cjs/api/cloud/StartupApi.js.map +1 -1
- package/cjs/api/cloud/StartupApi.test.js.map +1 -1
- package/cjs/api/cloud/VariablesApi.js +52 -20
- package/cjs/api/cloud/VariablesApi.js.map +1 -1
- package/cjs/api/cloud/VariablesApi.test.js.map +1 -1
- package/cjs/api/utils/ApiUtils.js +2 -5
- package/cjs/api/utils/ApiUtils.js.map +1 -1
- package/cjs/api/utils/ApiUtils.test.js.map +1 -1
- package/cjs/index.js +13 -112
- package/cjs/index.js.map +1 -1
- package/cjs/lib/FrodoLib.js +142 -0
- package/cjs/lib/FrodoLib.js.map +1 -0
- package/cjs/ops/AdminOps.js +578 -90
- package/cjs/ops/AdminOps.js.map +1 -1
- package/cjs/ops/AgentOps.js +964 -118
- package/cjs/ops/AgentOps.js.map +1 -1
- package/cjs/ops/AgentOps.test.js.map +1 -1
- package/cjs/ops/AuthenticateOps.js +182 -87
- package/cjs/ops/AuthenticateOps.js.map +1 -1
- package/cjs/ops/AuthenticateOps.test.js.map +1 -1
- package/cjs/ops/CirclesOfTrustOps.js +360 -291
- package/cjs/ops/CirclesOfTrustOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.js +221 -139
- package/cjs/ops/ConnectionProfileOps.js.map +1 -1
- package/cjs/ops/ConnectionProfileOps.test.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.js +84 -10
- package/cjs/ops/EmailTemplateOps.js.map +1 -1
- package/cjs/ops/EmailTemplateOps.test.js.map +1 -1
- package/cjs/ops/IdmOps.js +97 -81
- package/cjs/ops/IdmOps.js.map +1 -1
- package/cjs/ops/IdmOps.test.js.map +1 -1
- package/cjs/ops/IdpOps.js +275 -42
- package/cjs/ops/IdpOps.js.map +1 -1
- package/cjs/ops/IdpOps.test.js.map +1 -1
- package/cjs/ops/InfoOps.js +42 -27
- package/cjs/ops/InfoOps.js.map +1 -1
- package/cjs/ops/JoseOps.test.js.map +1 -1
- package/cjs/ops/JourneyOps.js +721 -126
- package/cjs/ops/JourneyOps.js.map +1 -1
- package/cjs/ops/JourneyOps.test.js.map +1 -1
- package/cjs/ops/ManagedObjectOps.js +79 -12
- package/cjs/ops/ManagedObjectOps.js.map +1 -1
- package/cjs/ops/NodeOps.js +127 -100
- package/cjs/ops/NodeOps.js.map +1 -1
- package/cjs/ops/OAuth2ClientOps.js +323 -65
- package/cjs/ops/OAuth2ClientOps.js.map +1 -1
- package/cjs/ops/OAuth2ClientOps.test.js.map +1 -1
- package/cjs/ops/OAuth2OidcOps.js +84 -0
- package/cjs/ops/OAuth2OidcOps.js.map +1 -0
- package/cjs/ops/OAuth2ProviderOps.js +20 -13
- package/cjs/ops/OAuth2ProviderOps.js.map +1 -1
- package/cjs/ops/OpsTypes.js.map +1 -1
- package/cjs/ops/OrganizationOps.js +67 -12
- package/cjs/ops/OrganizationOps.js.map +1 -1
- package/cjs/ops/PolicyOps.js +476 -136
- package/cjs/ops/PolicyOps.js.map +1 -1
- package/cjs/ops/PolicyOps.test.js.map +1 -1
- package/cjs/ops/PolicySetOps.js +402 -132
- package/cjs/ops/PolicySetOps.js.map +1 -1
- package/cjs/ops/PolicySetOps.test.js.map +1 -1
- package/cjs/ops/RealmOps.js +119 -84
- package/cjs/ops/RealmOps.js.map +1 -1
- package/cjs/ops/ResourceTypeOps.js +364 -95
- package/cjs/ops/ResourceTypeOps.js.map +1 -1
- package/cjs/ops/ResourceTypeOps.test.js.map +1 -1
- package/cjs/ops/Saml2Ops.js +407 -145
- package/cjs/ops/Saml2Ops.js.map +1 -1
- package/cjs/ops/Saml2Ops.test.js.map +1 -1
- package/cjs/ops/ScriptOps.js +256 -79
- package/cjs/ops/ScriptOps.js.map +1 -1
- package/cjs/ops/ScriptOps.test.js.map +1 -1
- package/cjs/ops/ServiceOps.js +331 -55
- package/cjs/ops/ServiceOps.js.map +1 -1
- package/cjs/ops/ThemeOps.js +363 -54
- package/cjs/ops/ThemeOps.js.map +1 -1
- package/cjs/ops/ThemeOps.test.js.map +1 -1
- package/cjs/ops/cloud/FeatureOps.js +57 -12
- package/cjs/ops/cloud/FeatureOps.js.map +1 -1
- package/cjs/ops/cloud/LogOps.js +126 -6
- package/cjs/ops/cloud/LogOps.js.map +1 -1
- package/cjs/ops/cloud/SecretsOps.js +230 -289
- package/cjs/ops/cloud/SecretsOps.js.map +1 -1
- package/cjs/ops/cloud/ServiceAccountOps.js +101 -18
- package/cjs/ops/cloud/ServiceAccountOps.js.map +1 -1
- package/cjs/ops/cloud/ServiceAccountOps.test.js.map +1 -1
- package/cjs/ops/cloud/StartupOps.js +64 -9
- package/cjs/ops/cloud/StartupOps.js.map +1 -1
- package/cjs/ops/cloud/VariablesOps.js +100 -175
- package/cjs/ops/cloud/VariablesOps.js.map +1 -1
- package/cjs/ops/utils/Console.js +9 -10
- package/cjs/ops/utils/Console.js.map +1 -1
- package/cjs/ops/utils/DataProtection.js +2 -2
- package/cjs/ops/utils/DataProtection.js.map +1 -1
- package/cjs/ops/utils/ExportImportUtils.js +144 -13
- 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 +7 -5
- 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 → ScriptValidationUtils.js} +1 -1
- package/cjs/ops/utils/ScriptValidationUtils.js.map +1 -0
- package/cjs/ops/utils/ScriptValidationUtils.test.js.map +1 -0
- package/cjs/ops/utils/Version.js +36 -6
- package/cjs/ops/utils/Version.js.map +1 -1
- package/cjs/ops/utils/Version.test.js.map +1 -1
- package/cjs/shared/State.js +453 -210
- package/cjs/shared/State.js.map +1 -1
- package/cjs/shared/State.test.js.map +1 -1
- package/cjs/utils/AutoSetupPolly.js +4 -1
- package/cjs/utils/AutoSetupPolly.js.map +1 -1
- package/esm/api/AgentApi.mjs +75 -27
- package/esm/api/AgentApi.test.mjs +319 -71
- package/esm/api/AuthenticateApi.mjs +15 -4
- package/esm/api/AuthenticateApi.test.mjs +27 -8
- package/esm/api/BaseApi.mjs +43 -19
- package/esm/api/CirclesOfTrustApi.mjs +39 -17
- package/esm/api/IdmConfigApi.mjs +44 -13
- package/esm/api/IdmSystemApi.mjs +7 -3
- package/esm/api/ManagedObjectApi.mjs +44 -20
- package/esm/api/NodeApi.mjs +59 -24
- package/esm/api/NodeApi.test.mjs +158 -40
- package/esm/api/OAuth2ClientApi.mjs +36 -15
- package/esm/api/OAuth2OIDCApi.mjs +69 -20
- package/esm/api/OAuth2OIDCApi.test.mjs +21 -3
- package/esm/api/OAuth2ProviderApi.mjs +8 -6
- package/esm/api/PoliciesApi.mjs +45 -16
- package/esm/api/PoliciesApi.test.mjs +63 -15
- package/esm/api/PolicySetApi.mjs +44 -16
- package/esm/api/PolicySetApi.test.mjs +48 -12
- package/esm/api/RealmApi.mjs +65 -24
- package/esm/api/ResourceTypesApi.mjs +56 -21
- package/esm/api/ResourceTypesApi.test.mjs +58 -14
- package/esm/api/Saml2Api.mjs +75 -89
- package/esm/api/ScriptApi.mjs +45 -17
- package/esm/api/ServerInfoApi.mjs +19 -6
- package/esm/api/ServiceApi.mjs +77 -26
- package/esm/api/SocialIdentityProvidersApi.mjs +58 -23
- package/esm/api/TreeApi.mjs +36 -15
- package/esm/api/TreeApi.test.mjs +129 -34
- package/esm/api/cloud/EnvInfoApi.mjs +8 -3
- package/esm/api/cloud/FeatureApi.mjs +7 -3
- package/esm/api/cloud/LogApi.mjs +38 -11
- package/esm/api/cloud/SecretsApi.mjs +89 -21
- package/esm/api/cloud/SecretsApi.test.mjs +193 -50
- package/esm/api/cloud/StartupApi.mjs +17 -6
- package/esm/api/cloud/StartupApi.test.mjs +28 -11
- package/esm/api/cloud/VariablesApi.mjs +43 -14
- package/esm/api/cloud/VariablesApi.test.mjs +124 -33
- package/esm/api/utils/ApiUtils.mjs +2 -4
- package/esm/api/utils/ApiUtils.test.mjs +14 -6
- package/esm/index.mjs +1 -60
- package/esm/lib/FrodoLib.mjs +128 -0
- package/esm/ops/AdminOps.mjs +500 -71
- package/esm/ops/AgentOps.mjs +781 -81
- package/esm/ops/AgentOps.test.mjs +296 -113
- package/esm/ops/AuthenticateOps.mjs +156 -64
- package/esm/ops/AuthenticateOps.test.mjs +7 -4
- package/esm/ops/CirclesOfTrustOps.mjs +294 -229
- package/esm/ops/ConnectionProfileOps.mjs +190 -123
- package/esm/ops/ConnectionProfileOps.test.mjs +25 -5
- package/esm/ops/EmailTemplateOps.mjs +66 -6
- package/esm/ops/EmailTemplateOps.test.mjs +32 -11
- package/esm/ops/IdmOps.mjs +60 -47
- package/esm/ops/IdmOps.test.mjs +54 -18
- package/esm/ops/IdpOps.mjs +227 -31
- package/esm/ops/IdpOps.test.mjs +57 -20
- package/esm/ops/InfoOps.mjs +36 -23
- package/esm/ops/JoseOps.test.mjs +8 -0
- package/esm/ops/JourneyOps.mjs +634 -96
- package/esm/ops/JourneyOps.test.mjs +73 -31
- package/esm/ops/ManagedObjectOps.mjs +66 -10
- package/esm/ops/NodeOps.mjs +108 -85
- package/esm/ops/OAuth2ClientOps.mjs +258 -42
- package/esm/ops/OAuth2ClientOps.test.mjs +80 -29
- package/esm/ops/OAuth2OidcOps.mjs +40 -0
- package/esm/ops/OAuth2ProviderOps.mjs +11 -8
- package/esm/ops/OrganizationOps.mjs +56 -8
- package/esm/ops/PolicyOps.mjs +379 -93
- package/esm/ops/PolicyOps.test.mjs +180 -65
- package/esm/ops/PolicySetOps.mjs +311 -88
- package/esm/ops/PolicySetOps.test.mjs +108 -39
- package/esm/ops/RealmOps.mjs +85 -65
- package/esm/ops/ResourceTypeOps.mjs +278 -61
- package/esm/ops/ResourceTypeOps.test.mjs +113 -27
- package/esm/ops/Saml2Ops.mjs +346 -106
- package/esm/ops/Saml2Ops.test.mjs +117 -81
- package/esm/ops/ScriptOps.mjs +202 -56
- package/esm/ops/ScriptOps.test.mjs +64 -23
- package/esm/ops/ServiceOps.mjs +261 -27
- package/esm/ops/ThemeOps.mjs +300 -33
- package/esm/ops/ThemeOps.test.mjs +197 -47
- package/esm/ops/cloud/FeatureOps.mjs +45 -10
- package/esm/ops/cloud/LogOps.mjs +107 -4
- package/esm/ops/cloud/SecretsOps.mjs +123 -204
- package/esm/ops/cloud/ServiceAccountOps.mjs +85 -15
- package/esm/ops/cloud/ServiceAccountOps.test.mjs +16 -6
- package/esm/ops/cloud/StartupOps.mjs +49 -6
- package/esm/ops/cloud/VariablesOps.mjs +58 -120
- package/esm/ops/utils/Console.mjs +2 -1
- package/esm/ops/utils/DataProtection.mjs +2 -3
- package/esm/ops/utils/ExportImportUtils.mjs +129 -8
- package/esm/ops/utils/ExportImportUtils.test.mjs +15 -2
- package/esm/ops/utils/OpsUtils.mjs +4 -3
- package/esm/ops/utils/OpsUtils.test.mjs +21 -5
- package/esm/ops/utils/{ValidationUtils.mjs → ScriptValidationUtils.mjs} +1 -1
- package/esm/ops/utils/{ValidationUtils.test.mjs → ScriptValidationUtils.test.mjs} +2 -2
- package/esm/ops/utils/Version.mjs +29 -6
- package/esm/ops/utils/Version.test.mjs +4 -1
- package/esm/shared/State.mjs +457 -145
- package/esm/shared/State.test.mjs +8 -0
- package/esm/utils/AutoSetupPolly.mjs +4 -1
- package/package.json +1 -1
- package/types/api/AgentApi.d.ts +37 -8
- package/types/api/AgentApi.d.ts.map +1 -1
- package/types/api/ApiTypes.d.ts +20 -8
- package/types/api/ApiTypes.d.ts.map +1 -1
- package/types/api/AuthenticateApi.d.ts +13 -3
- package/types/api/AuthenticateApi.d.ts.map +1 -1
- package/types/api/BaseApi.d.ts +36 -7
- package/types/api/BaseApi.d.ts.map +1 -1
- package/types/api/CirclesOfTrustApi.d.ts +21 -7
- package/types/api/CirclesOfTrustApi.d.ts.map +1 -1
- package/types/api/IdmConfigApi.d.ts +28 -13
- package/types/api/IdmConfigApi.d.ts.map +1 -1
- package/types/api/IdmSystemApi.d.ts +4 -1
- package/types/api/IdmSystemApi.d.ts.map +1 -1
- package/types/api/ManagedObjectApi.d.ts +25 -10
- package/types/api/ManagedObjectApi.d.ts.map +1 -1
- package/types/api/NodeApi.d.ts +31 -9
- package/types/api/NodeApi.d.ts.map +1 -1
- package/types/api/OAuth2ClientApi.d.ts +18 -5
- package/types/api/OAuth2ClientApi.d.ts.map +1 -1
- package/types/api/OAuth2OIDCApi.d.ts +45 -11
- package/types/api/OAuth2OIDCApi.d.ts.map +1 -1
- package/types/api/OAuth2ProviderApi.d.ts +4 -1
- package/types/api/OAuth2ProviderApi.d.ts.map +1 -1
- package/types/api/PoliciesApi.d.ts +21 -5
- package/types/api/PoliciesApi.d.ts.map +1 -1
- package/types/api/PolicySetApi.d.ts +20 -5
- package/types/api/PolicySetApi.d.ts.map +1 -1
- package/types/api/RealmApi.d.ts +26 -10
- package/types/api/RealmApi.d.ts.map +1 -1
- package/types/api/ResourceTypesApi.d.ts +27 -8
- package/types/api/ResourceTypesApi.d.ts.map +1 -1
- package/types/api/Saml2Api.d.ts +39 -32
- package/types/api/Saml2Api.d.ts.map +1 -1
- package/types/api/ScriptApi.d.ts +21 -5
- package/types/api/ScriptApi.d.ts.map +1 -1
- package/types/api/ServerInfoApi.d.ts +9 -2
- package/types/api/ServerInfoApi.d.ts.map +1 -1
- package/types/api/ServiceApi.d.ts +41 -7
- package/types/api/ServiceApi.d.ts.map +1 -1
- package/types/api/SocialIdentityProvidersApi.d.ts +30 -8
- package/types/api/SocialIdentityProvidersApi.d.ts.map +1 -1
- package/types/api/TreeApi.d.ts +18 -4
- package/types/api/TreeApi.d.ts.map +1 -1
- package/types/api/cloud/EnvInfoApi.d.ts +4 -1
- package/types/api/cloud/EnvInfoApi.d.ts.map +1 -1
- package/types/api/cloud/FeatureApi.d.ts +4 -1
- package/types/api/cloud/FeatureApi.d.ts.map +1 -1
- package/types/api/cloud/LogApi.d.ts +24 -6
- package/types/api/cloud/LogApi.d.ts.map +1 -1
- package/types/api/cloud/SecretsApi.d.ts +50 -10
- package/types/api/cloud/SecretsApi.d.ts.map +1 -1
- package/types/api/cloud/StartupApi.d.ts +7 -2
- package/types/api/cloud/StartupApi.d.ts.map +1 -1
- package/types/api/cloud/VariablesApi.d.ts +23 -5
- package/types/api/cloud/VariablesApi.d.ts.map +1 -1
- package/types/api/utils/ApiUtils.d.ts +3 -2
- package/types/api/utils/ApiUtils.d.ts.map +1 -1
- package/types/index.d.ts +1 -48
- package/types/index.d.ts.map +1 -1
- package/types/lib/FrodoLib.d.ts +99 -0
- package/types/lib/FrodoLib.d.ts.map +1 -0
- package/types/ops/AdminOps.d.ts +71 -12
- package/types/ops/AdminOps.d.ts.map +1 -1
- package/types/ops/AgentOps.d.ts +350 -36
- package/types/ops/AgentOps.d.ts.map +1 -1
- package/types/ops/AuthenticateOps.d.ts +27 -4
- package/types/ops/AuthenticateOps.d.ts.map +1 -1
- package/types/ops/CirclesOfTrustOps.d.ts +88 -24
- package/types/ops/CirclesOfTrustOps.d.ts.map +1 -1
- package/types/ops/ConnectionProfileOps.d.ts +78 -18
- package/types/ops/ConnectionProfileOps.d.ts.map +1 -1
- package/types/ops/EmailTemplateOps.d.ts +36 -3
- package/types/ops/EmailTemplateOps.d.ts.map +1 -1
- package/types/ops/IdmOps.d.ts +28 -40
- package/types/ops/IdmOps.d.ts.map +1 -1
- package/types/ops/IdpOps.d.ts +88 -10
- package/types/ops/IdpOps.d.ts.map +1 -1
- package/types/ops/InfoOps.d.ts +12 -1
- package/types/ops/InfoOps.d.ts.map +1 -1
- package/types/ops/JourneyOps.d.ts +237 -34
- package/types/ops/JourneyOps.d.ts.map +1 -1
- package/types/ops/ManagedObjectOps.d.ts +37 -8
- package/types/ops/ManagedObjectOps.d.ts.map +1 -1
- package/types/ops/NodeOps.d.ts +61 -6
- package/types/ops/NodeOps.d.ts.map +1 -1
- package/types/ops/OAuth2ClientOps.d.ts +104 -10
- package/types/ops/OAuth2ClientOps.d.ts.map +1 -1
- package/types/ops/OAuth2OidcOps.d.ts +11 -0
- package/types/ops/OAuth2OidcOps.d.ts.map +1 -0
- package/types/ops/OAuth2ProviderOps.d.ts +8 -5
- package/types/ops/OAuth2ProviderOps.d.ts.map +1 -1
- package/types/ops/OpsTypes.d.ts +12 -1
- package/types/ops/OpsTypes.d.ts.map +1 -1
- package/types/ops/OrganizationOps.d.ts +24 -3
- package/types/ops/OrganizationOps.d.ts.map +1 -1
- package/types/ops/PolicyOps.d.ts +103 -28
- package/types/ops/PolicyOps.d.ts.map +1 -1
- package/types/ops/PolicySetOps.d.ts +76 -30
- package/types/ops/PolicySetOps.d.ts.map +1 -1
- package/types/ops/RealmOps.d.ts +34 -14
- package/types/ops/RealmOps.d.ts.map +1 -1
- package/types/ops/ResourceTypeOps.d.ts +116 -29
- package/types/ops/ResourceTypeOps.d.ts.map +1 -1
- package/types/ops/Saml2Ops.d.ts +124 -41
- package/types/ops/Saml2Ops.d.ts.map +1 -1
- package/types/ops/ScriptOps.d.ts +88 -23
- package/types/ops/ScriptOps.d.ts.map +1 -1
- package/types/ops/ServiceOps.d.ts +95 -8
- package/types/ops/ServiceOps.d.ts.map +1 -1
- package/types/ops/ThemeOps.d.ts +113 -9
- package/types/ops/ThemeOps.d.ts.map +1 -1
- package/types/ops/cloud/FeatureOps.d.ts +23 -2
- package/types/ops/cloud/FeatureOps.d.ts.map +1 -1
- package/types/ops/cloud/LogOps.d.ts +61 -3
- package/types/ops/cloud/LogOps.d.ts.map +1 -1
- package/types/ops/cloud/SecretsOps.d.ts +77 -63
- package/types/ops/cloud/SecretsOps.d.ts.map +1 -1
- package/types/ops/cloud/ServiceAccountOps.d.ts +48 -3
- package/types/ops/cloud/ServiceAccountOps.d.ts.map +1 -1
- package/types/ops/cloud/StartupOps.d.ts +25 -2
- package/types/ops/cloud/StartupOps.d.ts.map +1 -1
- package/types/ops/cloud/VariablesOps.d.ts +39 -39
- package/types/ops/cloud/VariablesOps.d.ts.map +1 -1
- package/types/ops/utils/Console.d.ts.map +1 -1
- package/types/ops/utils/DataProtection.d.ts +1 -1
- package/types/ops/utils/DataProtection.d.ts.map +1 -1
- package/types/ops/utils/ExportImportUtils.d.ts +72 -11
- package/types/ops/utils/ExportImportUtils.d.ts.map +1 -1
- package/types/ops/utils/OpsUtils.d.ts +4 -1
- package/types/ops/utils/OpsUtils.d.ts.map +1 -1
- package/types/ops/utils/ScriptValidationUtils.d.ts.map +1 -0
- package/types/ops/utils/Version.d.ts +20 -2
- package/types/ops/utils/Version.d.ts.map +1 -1
- package/types/shared/State.d.ts +80 -177
- package/types/shared/State.d.ts.map +1 -1
- package/types/utils/AutoSetupPolly.d.ts.map +1 -1
- package/cjs/ops/utils/ValidationUtils.js.map +0 -1
- package/cjs/ops/utils/ValidationUtils.test.js.map +0 -1
- package/types/ops/utils/ValidationUtils.d.ts.map +0 -1
- /package/types/ops/utils/{ValidationUtils.d.ts → ScriptValidationUtils.d.ts} +0 -0
|
@@ -4,18 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.addNewServiceAccount = addNewServiceAccount;
|
|
7
|
+
exports.default = void 0;
|
|
7
8
|
exports.deleteConnectionProfile = deleteConnectionProfile;
|
|
8
|
-
exports.describeConnectionProfile = describeConnectionProfile;
|
|
9
9
|
exports.getConnectionProfile = getConnectionProfile;
|
|
10
10
|
exports.getConnectionProfileByHost = getConnectionProfileByHost;
|
|
11
11
|
exports.getConnectionProfilesPath = getConnectionProfilesPath;
|
|
12
12
|
exports.initConnectionProfiles = initConnectionProfiles;
|
|
13
|
-
exports.listConnectionProfiles = listConnectionProfiles;
|
|
14
13
|
exports.saveConnectionProfile = saveConnectionProfile;
|
|
15
14
|
var _fs = _interopRequireDefault(require("fs"));
|
|
16
15
|
var _os = _interopRequireDefault(require("os"));
|
|
17
16
|
var _path = _interopRequireDefault(require("path"));
|
|
18
|
-
var state = _interopRequireWildcard(require("../shared/State"));
|
|
19
17
|
var _DataProtection = _interopRequireDefault(require("./utils/DataProtection"));
|
|
20
18
|
var _Console = require("./utils/Console");
|
|
21
19
|
var _StaticStorage = require("../storage/StaticStorage");
|
|
@@ -23,17 +21,125 @@ var _JoseOps = require("./JoseOps");
|
|
|
23
21
|
var _ServiceAccountOps = require("./cloud/ServiceAccountOps");
|
|
24
22
|
var _ExportImportUtils = require("./utils/ExportImportUtils");
|
|
25
23
|
var _OpsUtils = require("./utils/OpsUtils");
|
|
26
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
30
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
31
25
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
32
26
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
33
27
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
34
28
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
35
29
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
36
|
-
var
|
|
30
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
31
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
32
|
+
class ConnectionProfileOps {
|
|
33
|
+
constructor(state) {
|
|
34
|
+
this.state = state;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get connection profiles file name
|
|
39
|
+
* @returns {string} connection profiles file name
|
|
40
|
+
*/
|
|
41
|
+
getConnectionProfilesPath() {
|
|
42
|
+
return getConnectionProfilesPath({
|
|
43
|
+
state: this.state
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Find connection profiles
|
|
49
|
+
* @param {ConnectionsFileInterface} connectionProfiles connection profile object
|
|
50
|
+
* @param {string} host host url or unique substring
|
|
51
|
+
* @returns {SecureConnectionProfileInterface[]} Array of connection profiles
|
|
52
|
+
*/
|
|
53
|
+
findConnectionProfiles(connectionProfiles, host) {
|
|
54
|
+
return findConnectionProfiles({
|
|
55
|
+
connectionProfiles,
|
|
56
|
+
host
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Initialize connection profiles
|
|
62
|
+
*
|
|
63
|
+
* This method is called from app.ts and runs before any of the message handlers are registered.
|
|
64
|
+
* Therefore none of the Console message functions will produce any output.
|
|
65
|
+
*/
|
|
66
|
+
initConnectionProfiles() {
|
|
67
|
+
var _this = this;
|
|
68
|
+
return _asyncToGenerator(function* () {
|
|
69
|
+
initConnectionProfiles({
|
|
70
|
+
state: _this.state
|
|
71
|
+
});
|
|
72
|
+
})();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Get connection profile by host
|
|
77
|
+
* @param {String} host host tenant host url or unique substring
|
|
78
|
+
* @returns {Object} connection profile or null
|
|
79
|
+
*/
|
|
80
|
+
getConnectionProfileByHost(host) {
|
|
81
|
+
var _this2 = this;
|
|
82
|
+
return _asyncToGenerator(function* () {
|
|
83
|
+
return getConnectionProfileByHost({
|
|
84
|
+
host,
|
|
85
|
+
state: _this2.state
|
|
86
|
+
});
|
|
87
|
+
})();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get connection profile
|
|
92
|
+
* @returns {Object} connection profile or null
|
|
93
|
+
*/
|
|
94
|
+
getConnectionProfile() {
|
|
95
|
+
var _this3 = this;
|
|
96
|
+
return _asyncToGenerator(function* () {
|
|
97
|
+
return getConnectionProfile({
|
|
98
|
+
state: _this3.state
|
|
99
|
+
});
|
|
100
|
+
})();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Save connection profile
|
|
105
|
+
* @param {string} host host url for new profiles or unique substring for existing profiles
|
|
106
|
+
* @returns {Promise<boolean>} true if the operation succeeded, false otherwise
|
|
107
|
+
*/
|
|
108
|
+
saveConnectionProfile(host) {
|
|
109
|
+
var _this4 = this;
|
|
110
|
+
return _asyncToGenerator(function* () {
|
|
111
|
+
return saveConnectionProfile({
|
|
112
|
+
host,
|
|
113
|
+
state: _this4.state
|
|
114
|
+
});
|
|
115
|
+
})();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Delete connection profile
|
|
120
|
+
* @param {string} host host tenant host url or unique substring
|
|
121
|
+
*/
|
|
122
|
+
deleteConnectionProfile(host) {
|
|
123
|
+
deleteConnectionProfile({
|
|
124
|
+
host,
|
|
125
|
+
state: this.state
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Create a new service account using auto-generated parameters
|
|
131
|
+
* @returns {Promise<IdObjectSkeletonInterface>} A promise resolving to a service account object
|
|
132
|
+
*/
|
|
133
|
+
addNewServiceAccount() {
|
|
134
|
+
var _this5 = this;
|
|
135
|
+
return _asyncToGenerator(function* () {
|
|
136
|
+
return addNewServiceAccount({
|
|
137
|
+
state: _this5.state
|
|
138
|
+
});
|
|
139
|
+
})();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
exports.default = ConnectionProfileOps;
|
|
37
143
|
var fileOptions = {
|
|
38
144
|
indentation: 4
|
|
39
145
|
};
|
|
@@ -42,9 +148,13 @@ var newProfileFilename = 'Connections.json';
|
|
|
42
148
|
|
|
43
149
|
/**
|
|
44
150
|
* Get connection profiles file name
|
|
151
|
+
* @param {State} state library state
|
|
45
152
|
* @returns {String} connection profiles file name
|
|
46
153
|
*/
|
|
47
|
-
function getConnectionProfilesPath() {
|
|
154
|
+
function getConnectionProfilesPath(_ref) {
|
|
155
|
+
var {
|
|
156
|
+
state
|
|
157
|
+
} = _ref;
|
|
48
158
|
return state.getConnectionProfilesPath() || process.env[_StaticStorage.FRODO_CONNECTION_PROFILES_PATH_KEY] || "".concat(_os.default.homedir(), "/.frodo/").concat(newProfileFilename);
|
|
49
159
|
}
|
|
50
160
|
|
|
@@ -52,9 +162,14 @@ function getConnectionProfilesPath() {
|
|
|
52
162
|
* Find connection profiles
|
|
53
163
|
* @param {ConnectionsFileInterface} connectionProfiles connection profile object
|
|
54
164
|
* @param {string} host host url or unique substring
|
|
165
|
+
* @param {State} state library state
|
|
55
166
|
* @returns {SecureConnectionProfileInterface[]} Array of connection profiles
|
|
56
167
|
*/
|
|
57
|
-
function findConnectionProfiles(
|
|
168
|
+
function findConnectionProfiles(_ref2) {
|
|
169
|
+
var {
|
|
170
|
+
connectionProfiles,
|
|
171
|
+
host
|
|
172
|
+
} = _ref2;
|
|
58
173
|
var profiles = [];
|
|
59
174
|
for (var tenant in connectionProfiles) {
|
|
60
175
|
(0, _Console.debugMessage)("ConnectionProfileOps.findConnectionProfiles: tenant=".concat(tenant));
|
|
@@ -68,39 +183,6 @@ function findConnectionProfiles(connectionProfiles, host) {
|
|
|
68
183
|
return profiles;
|
|
69
184
|
}
|
|
70
185
|
|
|
71
|
-
/**
|
|
72
|
-
* List connection profiles
|
|
73
|
-
* @param {boolean} long Long list format with details
|
|
74
|
-
*/
|
|
75
|
-
function listConnectionProfiles() {
|
|
76
|
-
var long = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
77
|
-
var filename = getConnectionProfilesPath();
|
|
78
|
-
try {
|
|
79
|
-
var data = _fs.default.readFileSync(filename, 'utf8');
|
|
80
|
-
var connectionsData = JSON.parse(data);
|
|
81
|
-
if (Object.keys(connectionsData).length < 1) {
|
|
82
|
-
(0, _Console.printMessage)("No connections defined yet in ".concat(filename), 'info');
|
|
83
|
-
} else {
|
|
84
|
-
if (long) {
|
|
85
|
-
var table = (0, _Console.createTable)(['Host', 'Service Account', 'Username', 'Log API Key']);
|
|
86
|
-
Object.keys(connectionsData).forEach(c => {
|
|
87
|
-
table.push([c, connectionsData[c].svcacctName || connectionsData[c].svcacctId, connectionsData[c].username, connectionsData[c].logApiKey]);
|
|
88
|
-
});
|
|
89
|
-
(0, _Console.printMessage)(table.toString(), 'data');
|
|
90
|
-
} else {
|
|
91
|
-
Object.keys(connectionsData).forEach(c => {
|
|
92
|
-
(0, _Console.printMessage)("".concat(c), 'data');
|
|
93
|
-
});
|
|
94
|
-
// getUniqueNames(5, Object.keys(connectionsData));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
(0, _Console.printMessage)('Any unique substring of a saved host can be used as the value for host parameter in all commands', 'info');
|
|
98
|
-
}
|
|
99
|
-
} catch (e) {
|
|
100
|
-
(0, _Console.printMessage)("No connections found in ".concat(filename, " (").concat(e.message, ")"), 'error');
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
186
|
/**
|
|
105
187
|
* Migrate from .frodorc to Connections.json
|
|
106
188
|
*/
|
|
@@ -126,19 +208,27 @@ function migrateFromLegacyProfile() {
|
|
|
126
208
|
*
|
|
127
209
|
* This method is called from app.ts and runs before any of the message handlers are registered.
|
|
128
210
|
* Therefore none of the Console message functions will produce any output.
|
|
211
|
+
* @param {State} state library state
|
|
129
212
|
*/
|
|
130
|
-
function initConnectionProfiles() {
|
|
213
|
+
function initConnectionProfiles(_x) {
|
|
131
214
|
return _initConnectionProfiles.apply(this, arguments);
|
|
132
215
|
}
|
|
133
216
|
/**
|
|
134
217
|
* Get connection profile by host
|
|
135
218
|
* @param {String} host host tenant host url or unique substring
|
|
219
|
+
* @param {State} state library state
|
|
136
220
|
* @returns {Object} connection profile or null
|
|
137
221
|
*/
|
|
138
222
|
function _initConnectionProfiles() {
|
|
139
|
-
_initConnectionProfiles = _asyncToGenerator(function* () {
|
|
223
|
+
_initConnectionProfiles = _asyncToGenerator(function* (_ref3) {
|
|
224
|
+
var {
|
|
225
|
+
state
|
|
226
|
+
} = _ref3;
|
|
227
|
+
var dataProtection = new _DataProtection.default(state.getMasterKeyPath());
|
|
140
228
|
// create connections.json file if it doesn't exist
|
|
141
|
-
var filename = getConnectionProfilesPath(
|
|
229
|
+
var filename = getConnectionProfilesPath({
|
|
230
|
+
state
|
|
231
|
+
});
|
|
142
232
|
var folderName = _path.default.dirname(filename);
|
|
143
233
|
if (!_fs.default.existsSync(folderName)) {
|
|
144
234
|
_fs.default.mkdirSync(folderName, {
|
|
@@ -157,17 +247,17 @@ function _initConnectionProfiles() {
|
|
|
157
247
|
for (var conn of Object.keys(connectionsData)) {
|
|
158
248
|
if (connectionsData[conn]['password']) {
|
|
159
249
|
convert = true;
|
|
160
|
-
connectionsData[conn].encodedPassword = yield
|
|
250
|
+
connectionsData[conn].encodedPassword = yield dataProtection.encrypt(connectionsData[conn]['password']);
|
|
161
251
|
delete connectionsData[conn]['password'];
|
|
162
252
|
}
|
|
163
253
|
if (connectionsData[conn]['logApiSecret']) {
|
|
164
254
|
convert = true;
|
|
165
|
-
connectionsData[conn].encodedLogApiSecret = yield
|
|
255
|
+
connectionsData[conn].encodedLogApiSecret = yield dataProtection.encrypt(connectionsData[conn]['logApiSecret']);
|
|
166
256
|
delete connectionsData[conn]['logApiSecret'];
|
|
167
257
|
}
|
|
168
258
|
if (connectionsData[conn]['svcacctJwk']) {
|
|
169
259
|
convert = true;
|
|
170
|
-
connectionsData[conn].encodedSvcacctJwk = yield
|
|
260
|
+
connectionsData[conn].encodedSvcacctJwk = yield dataProtection.encrypt(connectionsData[conn]['svcacctJwk']);
|
|
171
261
|
delete connectionsData[conn]['svcacctJwk'];
|
|
172
262
|
}
|
|
173
263
|
}
|
|
@@ -178,7 +268,7 @@ function _initConnectionProfiles() {
|
|
|
178
268
|
});
|
|
179
269
|
return _initConnectionProfiles.apply(this, arguments);
|
|
180
270
|
}
|
|
181
|
-
function getConnectionProfileByHost(
|
|
271
|
+
function getConnectionProfileByHost(_x2) {
|
|
182
272
|
return _getConnectionProfileByHost.apply(this, arguments);
|
|
183
273
|
}
|
|
184
274
|
/**
|
|
@@ -186,11 +276,21 @@ function getConnectionProfileByHost(_x) {
|
|
|
186
276
|
* @returns {Object} connection profile or null
|
|
187
277
|
*/
|
|
188
278
|
function _getConnectionProfileByHost() {
|
|
189
|
-
_getConnectionProfileByHost = _asyncToGenerator(function* (
|
|
279
|
+
_getConnectionProfileByHost = _asyncToGenerator(function* (_ref4) {
|
|
280
|
+
var {
|
|
281
|
+
host,
|
|
282
|
+
state
|
|
283
|
+
} = _ref4;
|
|
190
284
|
try {
|
|
191
|
-
var
|
|
285
|
+
var dataProtection = new _DataProtection.default(state.getMasterKeyPath());
|
|
286
|
+
var filename = getConnectionProfilesPath({
|
|
287
|
+
state
|
|
288
|
+
});
|
|
192
289
|
var connectionsData = JSON.parse(_fs.default.readFileSync(filename, 'utf8'));
|
|
193
|
-
var profiles = findConnectionProfiles(
|
|
290
|
+
var profiles = findConnectionProfiles({
|
|
291
|
+
connectionProfiles: connectionsData,
|
|
292
|
+
host
|
|
293
|
+
});
|
|
194
294
|
if (profiles.length == 0) {
|
|
195
295
|
(0, _Console.printMessage)("Profile for ".concat(host, " not found. Please specify credentials on command line"), 'error');
|
|
196
296
|
return null;
|
|
@@ -206,14 +306,14 @@ function _getConnectionProfileByHost() {
|
|
|
206
306
|
return {
|
|
207
307
|
tenant: profiles[0].tenant,
|
|
208
308
|
username: profiles[0].username ? profiles[0].username : null,
|
|
209
|
-
password: profiles[0].encodedPassword ? yield
|
|
309
|
+
password: profiles[0].encodedPassword ? yield dataProtection.decrypt(profiles[0].encodedPassword) : null,
|
|
210
310
|
logApiKey: profiles[0].logApiKey ? profiles[0].logApiKey : null,
|
|
211
|
-
logApiSecret: profiles[0].encodedLogApiSecret ? yield
|
|
311
|
+
logApiSecret: profiles[0].encodedLogApiSecret ? yield dataProtection.decrypt(profiles[0].encodedLogApiSecret) : null,
|
|
212
312
|
authenticationService: profiles[0].authenticationService ? profiles[0].authenticationService : null,
|
|
213
313
|
authenticationHeaderOverrides: profiles[0].authenticationHeaderOverrides ? profiles[0].authenticationHeaderOverrides : {},
|
|
214
314
|
svcacctName: profiles[0].svcacctName ? profiles[0].svcacctName : null,
|
|
215
315
|
svcacctId: profiles[0].svcacctId ? profiles[0].svcacctId : null,
|
|
216
|
-
svcacctJwk: profiles[0].encodedSvcacctJwk ? yield
|
|
316
|
+
svcacctJwk: profiles[0].encodedSvcacctJwk ? yield dataProtection.decrypt(profiles[0].encodedSvcacctJwk) : null
|
|
217
317
|
};
|
|
218
318
|
} catch (e) {
|
|
219
319
|
(0, _Console.printMessage)("Can not read saved connection info, please specify credentials on command line: ".concat(e), 'error');
|
|
@@ -222,7 +322,7 @@ function _getConnectionProfileByHost() {
|
|
|
222
322
|
});
|
|
223
323
|
return _getConnectionProfileByHost.apply(this, arguments);
|
|
224
324
|
}
|
|
225
|
-
function getConnectionProfile() {
|
|
325
|
+
function getConnectionProfile(_x3) {
|
|
226
326
|
return _getConnectionProfile.apply(this, arguments);
|
|
227
327
|
}
|
|
228
328
|
/**
|
|
@@ -231,12 +331,18 @@ function getConnectionProfile() {
|
|
|
231
331
|
* @returns {Promise<boolean>} true if the operation succeeded, false otherwise
|
|
232
332
|
*/
|
|
233
333
|
function _getConnectionProfile() {
|
|
234
|
-
_getConnectionProfile = _asyncToGenerator(function* () {
|
|
235
|
-
|
|
334
|
+
_getConnectionProfile = _asyncToGenerator(function* (_ref5) {
|
|
335
|
+
var {
|
|
336
|
+
state
|
|
337
|
+
} = _ref5;
|
|
338
|
+
return getConnectionProfileByHost({
|
|
339
|
+
host: state.getHost(),
|
|
340
|
+
state
|
|
341
|
+
});
|
|
236
342
|
});
|
|
237
343
|
return _getConnectionProfile.apply(this, arguments);
|
|
238
344
|
}
|
|
239
|
-
function saveConnectionProfile(
|
|
345
|
+
function saveConnectionProfile(_x4) {
|
|
240
346
|
return _saveConnectionProfile.apply(this, arguments);
|
|
241
347
|
}
|
|
242
348
|
/**
|
|
@@ -244,9 +350,16 @@ function saveConnectionProfile(_x2) {
|
|
|
244
350
|
* @param {String} host host tenant host url or unique substring
|
|
245
351
|
*/
|
|
246
352
|
function _saveConnectionProfile() {
|
|
247
|
-
_saveConnectionProfile = _asyncToGenerator(function* (
|
|
353
|
+
_saveConnectionProfile = _asyncToGenerator(function* (_ref6) {
|
|
354
|
+
var {
|
|
355
|
+
host,
|
|
356
|
+
state
|
|
357
|
+
} = _ref6;
|
|
248
358
|
(0, _Console.debugMessage)("ConnectionProfileOps.saveConnectionProfile: start");
|
|
249
|
-
var
|
|
359
|
+
var dataProtection = new _DataProtection.default(state.getMasterKeyPath());
|
|
360
|
+
var filename = getConnectionProfilesPath({
|
|
361
|
+
state
|
|
362
|
+
});
|
|
250
363
|
(0, _Console.debugMessage)("Saving connection profile in ".concat(filename));
|
|
251
364
|
var profiles = {};
|
|
252
365
|
var profile = {
|
|
@@ -258,7 +371,10 @@ function _saveConnectionProfile() {
|
|
|
258
371
|
profiles = JSON.parse(data);
|
|
259
372
|
|
|
260
373
|
// find tenant
|
|
261
|
-
var found = findConnectionProfiles(
|
|
374
|
+
var found = findConnectionProfiles({
|
|
375
|
+
connectionProfiles: profiles,
|
|
376
|
+
host
|
|
377
|
+
});
|
|
262
378
|
|
|
263
379
|
// replace tenant in session with real tenant url if necessary
|
|
264
380
|
if (found.length === 1) {
|
|
@@ -285,21 +401,27 @@ function _saveConnectionProfile() {
|
|
|
285
401
|
|
|
286
402
|
// user account
|
|
287
403
|
if (state.getUsername()) profile.username = state.getUsername();
|
|
288
|
-
if (state.getPassword()) profile.encodedPassword = yield
|
|
404
|
+
if (state.getPassword()) profile.encodedPassword = yield dataProtection.encrypt(state.getPassword());
|
|
289
405
|
|
|
290
406
|
// log API
|
|
291
407
|
if (state.getLogApiKey()) profile.logApiKey = state.getLogApiKey();
|
|
292
|
-
if (state.getLogApiSecret()) profile.encodedLogApiSecret = yield
|
|
408
|
+
if (state.getLogApiSecret()) profile.encodedLogApiSecret = yield dataProtection.encrypt(state.getLogApiSecret());
|
|
293
409
|
|
|
294
410
|
// service account
|
|
295
411
|
if (state.getServiceAccountId()) {
|
|
296
412
|
profile.svcacctId = state.getServiceAccountId();
|
|
297
|
-
profile.svcacctName = (yield (0, _ServiceAccountOps.getServiceAccount)(
|
|
413
|
+
profile.svcacctName = (yield (0, _ServiceAccountOps.getServiceAccount)({
|
|
414
|
+
serviceAccountId: state.getServiceAccountId(),
|
|
415
|
+
state
|
|
416
|
+
})).name;
|
|
298
417
|
}
|
|
299
|
-
if (state.getServiceAccountJwk()) profile.encodedSvcacctJwk = yield
|
|
418
|
+
if (state.getServiceAccountJwk()) profile.encodedSvcacctJwk = yield dataProtection.encrypt(state.getServiceAccountJwk());
|
|
300
419
|
// update existing service account profile
|
|
301
420
|
if (profile.svcacctId && !profile.svcacctName) {
|
|
302
|
-
profile.svcacctName = (yield (0, _ServiceAccountOps.getServiceAccount)(
|
|
421
|
+
profile.svcacctName = (yield (0, _ServiceAccountOps.getServiceAccount)({
|
|
422
|
+
serviceAccountId: profile.svcacctId,
|
|
423
|
+
state
|
|
424
|
+
})).name;
|
|
303
425
|
(0, _Console.debugMessage)("ConnectionProfileOps.saveConnectionProfile: added missing service account name");
|
|
304
426
|
}
|
|
305
427
|
|
|
@@ -327,21 +449,35 @@ function _saveConnectionProfile() {
|
|
|
327
449
|
}, {});
|
|
328
450
|
|
|
329
451
|
// save profiles
|
|
330
|
-
(0, _ExportImportUtils.saveJsonToFile)(
|
|
452
|
+
(0, _ExportImportUtils.saveJsonToFile)({
|
|
453
|
+
data: orderedProfiles,
|
|
454
|
+
filename,
|
|
455
|
+
includeMeta: false,
|
|
456
|
+
state
|
|
457
|
+
});
|
|
331
458
|
(0, _Console.verboseMessage)("Saved connection profile ".concat(state.getHost(), " in ").concat(filename));
|
|
332
459
|
(0, _Console.debugMessage)("ConnectionProfileOps.saveConnectionProfile: end [true]");
|
|
333
460
|
return true;
|
|
334
461
|
});
|
|
335
462
|
return _saveConnectionProfile.apply(this, arguments);
|
|
336
463
|
}
|
|
337
|
-
function deleteConnectionProfile(
|
|
338
|
-
var
|
|
464
|
+
function deleteConnectionProfile(_ref7) {
|
|
465
|
+
var {
|
|
466
|
+
host,
|
|
467
|
+
state
|
|
468
|
+
} = _ref7;
|
|
469
|
+
var filename = getConnectionProfilesPath({
|
|
470
|
+
state
|
|
471
|
+
});
|
|
339
472
|
var connectionsData = {};
|
|
340
473
|
_fs.default.stat(filename, err => {
|
|
341
474
|
if (err == null) {
|
|
342
475
|
var data = _fs.default.readFileSync(filename, 'utf8');
|
|
343
476
|
connectionsData = JSON.parse(data);
|
|
344
|
-
var profiles = findConnectionProfiles(
|
|
477
|
+
var profiles = findConnectionProfiles({
|
|
478
|
+
connectionProfiles: connectionsData,
|
|
479
|
+
host
|
|
480
|
+
});
|
|
345
481
|
if (profiles.length == 1) {
|
|
346
482
|
delete connectionsData[profiles[0].tenant];
|
|
347
483
|
_fs.default.writeFileSync(filename, JSON.stringify(connectionsData, null, 2));
|
|
@@ -366,79 +502,18 @@ function deleteConnectionProfile(host) {
|
|
|
366
502
|
});
|
|
367
503
|
}
|
|
368
504
|
|
|
369
|
-
/**
|
|
370
|
-
* Describe connection profile
|
|
371
|
-
* @param {string} host Host URL or unique substring
|
|
372
|
-
* @param {boolean} showSecrets Whether secrets should be shown in clear text or not
|
|
373
|
-
*/
|
|
374
|
-
function describeConnectionProfile(_x3, _x4) {
|
|
375
|
-
return _describeConnectionProfile.apply(this, arguments);
|
|
376
|
-
}
|
|
377
505
|
/**
|
|
378
506
|
* Create a new service account using auto-generated parameters
|
|
379
507
|
* @returns {Promise<IdObjectSkeletonInterface>} A promise resolving to a service account object
|
|
380
508
|
*/
|
|
381
|
-
function
|
|
382
|
-
_describeConnectionProfile = _asyncToGenerator(function* (host, showSecrets) {
|
|
383
|
-
(0, _Console.debugMessage)("ConnectionProfileOps.describeConnectionProfile: start");
|
|
384
|
-
var profile = yield getConnectionProfileByHost(host);
|
|
385
|
-
if (profile) {
|
|
386
|
-
(0, _Console.debugMessage)(profile);
|
|
387
|
-
var present = '[present]';
|
|
388
|
-
var jwk = profile.svcacctJwk;
|
|
389
|
-
if (!showSecrets) {
|
|
390
|
-
if (profile.password) profile.password = present;
|
|
391
|
-
if (profile.logApiSecret) profile.logApiSecret = present;
|
|
392
|
-
if (profile.svcacctJwk) profile['svcacctJwk'] = present;
|
|
393
|
-
}
|
|
394
|
-
if (!profile.username) {
|
|
395
|
-
delete profile.username;
|
|
396
|
-
delete profile.password;
|
|
397
|
-
}
|
|
398
|
-
if (!profile.logApiKey) {
|
|
399
|
-
delete profile.logApiKey;
|
|
400
|
-
delete profile.logApiSecret;
|
|
401
|
-
}
|
|
402
|
-
if (!profile.svcacctId) {
|
|
403
|
-
delete profile.svcacctId;
|
|
404
|
-
delete profile.svcacctJwk;
|
|
405
|
-
delete profile.svcacctName;
|
|
406
|
-
}
|
|
407
|
-
if (showSecrets && jwk) {
|
|
408
|
-
profile['svcacctJwk'] = 'see below';
|
|
409
|
-
}
|
|
410
|
-
if (!profile.authenticationService) {
|
|
411
|
-
delete profile.authenticationService;
|
|
412
|
-
}
|
|
413
|
-
var keyMap = {
|
|
414
|
-
tenant: 'Host',
|
|
415
|
-
username: 'Username',
|
|
416
|
-
password: 'Password',
|
|
417
|
-
logApiKey: 'Log API Key',
|
|
418
|
-
logApiSecret: 'Log API Secret',
|
|
419
|
-
authenticationService: 'Authentication Service',
|
|
420
|
-
authenticationHeaderOverrides: 'Authentication Header Overrides',
|
|
421
|
-
svcacctName: 'Service Account Name',
|
|
422
|
-
svcacctId: 'Service Account Id',
|
|
423
|
-
svcacctJwk: 'Service Account JWK'
|
|
424
|
-
};
|
|
425
|
-
var table = (0, _Console.createObjectTable)(profile, keyMap);
|
|
426
|
-
(0, _Console.printMessage)(table.toString(), 'data');
|
|
427
|
-
if (showSecrets && jwk) {
|
|
428
|
-
(0, _Console.printMessage)(jwk, 'data');
|
|
429
|
-
}
|
|
430
|
-
} else {
|
|
431
|
-
(0, _Console.printMessage)("No connection profile ".concat(host, " found"));
|
|
432
|
-
}
|
|
433
|
-
(0, _Console.debugMessage)("ConnectionProfileOps.describeConnectionProfile: end");
|
|
434
|
-
});
|
|
435
|
-
return _describeConnectionProfile.apply(this, arguments);
|
|
436
|
-
}
|
|
437
|
-
function addNewServiceAccount() {
|
|
509
|
+
function addNewServiceAccount(_x5) {
|
|
438
510
|
return _addNewServiceAccount.apply(this, arguments);
|
|
439
511
|
}
|
|
440
512
|
function _addNewServiceAccount() {
|
|
441
|
-
_addNewServiceAccount = _asyncToGenerator(function* () {
|
|
513
|
+
_addNewServiceAccount = _asyncToGenerator(function* (_ref8) {
|
|
514
|
+
var {
|
|
515
|
+
state
|
|
516
|
+
} = _ref8;
|
|
442
517
|
(0, _Console.debugMessage)("ConnectionProfileOps.addNewServiceAccount: start");
|
|
443
518
|
var name = "Frodo-SA-".concat(new Date().getTime());
|
|
444
519
|
(0, _Console.debugMessage)("ConnectionProfileOps.addNewServiceAccount: name=".concat(name, "..."));
|
|
@@ -447,7 +522,14 @@ function _addNewServiceAccount() {
|
|
|
447
522
|
var jwkPrivate = yield (0, _JoseOps.createJwkRsa)();
|
|
448
523
|
var jwkPublic = yield (0, _JoseOps.getJwkRsaPublic)(jwkPrivate);
|
|
449
524
|
var jwks = (0, _JoseOps.createJwks)(jwkPublic);
|
|
450
|
-
var sa = yield (0, _ServiceAccountOps.createServiceAccount)(
|
|
525
|
+
var sa = yield (0, _ServiceAccountOps.createServiceAccount)({
|
|
526
|
+
name,
|
|
527
|
+
description,
|
|
528
|
+
accountStatus: 'Active',
|
|
529
|
+
scopes: scope,
|
|
530
|
+
jwks,
|
|
531
|
+
state
|
|
532
|
+
});
|
|
451
533
|
(0, _Console.debugMessage)("ConnectionProfileOps.addNewServiceAccount: id=".concat(sa._id));
|
|
452
534
|
state.setServiceAccountId(sa._id);
|
|
453
535
|
state.setServiceAccountJwk(jwkPrivate);
|