@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
|
@@ -1,15 +1,108 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import os from 'os';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import * as state from '../shared/State';
|
|
5
4
|
import DataProtection from './utils/DataProtection';
|
|
6
|
-
import {
|
|
5
|
+
import { debugMessage, printMessage, verboseMessage } from './utils/Console';
|
|
7
6
|
import { FRODO_CONNECTION_PROFILES_PATH_KEY } from '../storage/StaticStorage';
|
|
8
7
|
import { createJwkRsa, createJwks, getJwkRsaPublic } from './JoseOps';
|
|
9
8
|
import { createServiceAccount, getServiceAccount } from './cloud/ServiceAccountOps';
|
|
10
9
|
import { saveJsonToFile } from './utils/ExportImportUtils';
|
|
11
10
|
import { isValidUrl } from './utils/OpsUtils';
|
|
12
|
-
|
|
11
|
+
export default class ConnectionProfileOps {
|
|
12
|
+
constructor(state) {
|
|
13
|
+
this.state = state;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Get connection profiles file name
|
|
18
|
+
* @returns {string} connection profiles file name
|
|
19
|
+
*/
|
|
20
|
+
getConnectionProfilesPath() {
|
|
21
|
+
return getConnectionProfilesPath({
|
|
22
|
+
state: this.state
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Find connection profiles
|
|
28
|
+
* @param {ConnectionsFileInterface} connectionProfiles connection profile object
|
|
29
|
+
* @param {string} host host url or unique substring
|
|
30
|
+
* @returns {SecureConnectionProfileInterface[]} Array of connection profiles
|
|
31
|
+
*/
|
|
32
|
+
findConnectionProfiles(connectionProfiles, host) {
|
|
33
|
+
return findConnectionProfiles({
|
|
34
|
+
connectionProfiles,
|
|
35
|
+
host
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Initialize connection profiles
|
|
41
|
+
*
|
|
42
|
+
* This method is called from app.ts and runs before any of the message handlers are registered.
|
|
43
|
+
* Therefore none of the Console message functions will produce any output.
|
|
44
|
+
*/
|
|
45
|
+
async initConnectionProfiles() {
|
|
46
|
+
initConnectionProfiles({
|
|
47
|
+
state: this.state
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Get connection profile by host
|
|
53
|
+
* @param {String} host host tenant host url or unique substring
|
|
54
|
+
* @returns {Object} connection profile or null
|
|
55
|
+
*/
|
|
56
|
+
async getConnectionProfileByHost(host) {
|
|
57
|
+
return getConnectionProfileByHost({
|
|
58
|
+
host,
|
|
59
|
+
state: this.state
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Get connection profile
|
|
65
|
+
* @returns {Object} connection profile or null
|
|
66
|
+
*/
|
|
67
|
+
async getConnectionProfile() {
|
|
68
|
+
return getConnectionProfile({
|
|
69
|
+
state: this.state
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Save connection profile
|
|
75
|
+
* @param {string} host host url for new profiles or unique substring for existing profiles
|
|
76
|
+
* @returns {Promise<boolean>} true if the operation succeeded, false otherwise
|
|
77
|
+
*/
|
|
78
|
+
async saveConnectionProfile(host) {
|
|
79
|
+
return saveConnectionProfile({
|
|
80
|
+
host,
|
|
81
|
+
state: this.state
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Delete connection profile
|
|
87
|
+
* @param {string} host host tenant host url or unique substring
|
|
88
|
+
*/
|
|
89
|
+
deleteConnectionProfile(host) {
|
|
90
|
+
deleteConnectionProfile({
|
|
91
|
+
host,
|
|
92
|
+
state: this.state
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Create a new service account using auto-generated parameters
|
|
98
|
+
* @returns {Promise<IdObjectSkeletonInterface>} A promise resolving to a service account object
|
|
99
|
+
*/
|
|
100
|
+
async addNewServiceAccount() {
|
|
101
|
+
return addNewServiceAccount({
|
|
102
|
+
state: this.state
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
13
106
|
const fileOptions = {
|
|
14
107
|
indentation: 4
|
|
15
108
|
};
|
|
@@ -18,9 +111,12 @@ const newProfileFilename = 'Connections.json';
|
|
|
18
111
|
|
|
19
112
|
/**
|
|
20
113
|
* Get connection profiles file name
|
|
114
|
+
* @param {State} state library state
|
|
21
115
|
* @returns {String} connection profiles file name
|
|
22
116
|
*/
|
|
23
|
-
export function getConnectionProfilesPath(
|
|
117
|
+
export function getConnectionProfilesPath({
|
|
118
|
+
state
|
|
119
|
+
}) {
|
|
24
120
|
return state.getConnectionProfilesPath() || process.env[FRODO_CONNECTION_PROFILES_PATH_KEY] || `${os.homedir()}/.frodo/${newProfileFilename}`;
|
|
25
121
|
}
|
|
26
122
|
|
|
@@ -28,9 +124,13 @@ export function getConnectionProfilesPath() {
|
|
|
28
124
|
* Find connection profiles
|
|
29
125
|
* @param {ConnectionsFileInterface} connectionProfiles connection profile object
|
|
30
126
|
* @param {string} host host url or unique substring
|
|
127
|
+
* @param {State} state library state
|
|
31
128
|
* @returns {SecureConnectionProfileInterface[]} Array of connection profiles
|
|
32
129
|
*/
|
|
33
|
-
function findConnectionProfiles(
|
|
130
|
+
function findConnectionProfiles({
|
|
131
|
+
connectionProfiles,
|
|
132
|
+
host
|
|
133
|
+
}) {
|
|
34
134
|
const profiles = [];
|
|
35
135
|
for (const tenant in connectionProfiles) {
|
|
36
136
|
debugMessage(`ConnectionProfileOps.findConnectionProfiles: tenant=${tenant}`);
|
|
@@ -46,38 +146,6 @@ function findConnectionProfiles(connectionProfiles, host) {
|
|
|
46
146
|
return profiles;
|
|
47
147
|
}
|
|
48
148
|
|
|
49
|
-
/**
|
|
50
|
-
* List connection profiles
|
|
51
|
-
* @param {boolean} long Long list format with details
|
|
52
|
-
*/
|
|
53
|
-
export function listConnectionProfiles(long = false) {
|
|
54
|
-
const filename = getConnectionProfilesPath();
|
|
55
|
-
try {
|
|
56
|
-
const data = fs.readFileSync(filename, 'utf8');
|
|
57
|
-
const connectionsData = JSON.parse(data);
|
|
58
|
-
if (Object.keys(connectionsData).length < 1) {
|
|
59
|
-
printMessage(`No connections defined yet in ${filename}`, 'info');
|
|
60
|
-
} else {
|
|
61
|
-
if (long) {
|
|
62
|
-
const table = createTable(['Host', 'Service Account', 'Username', 'Log API Key']);
|
|
63
|
-
Object.keys(connectionsData).forEach(c => {
|
|
64
|
-
table.push([c, connectionsData[c].svcacctName || connectionsData[c].svcacctId, connectionsData[c].username, connectionsData[c].logApiKey]);
|
|
65
|
-
});
|
|
66
|
-
printMessage(table.toString(), 'data');
|
|
67
|
-
} else {
|
|
68
|
-
Object.keys(connectionsData).forEach(c => {
|
|
69
|
-
printMessage(`${c}`, 'data');
|
|
70
|
-
});
|
|
71
|
-
// getUniqueNames(5, Object.keys(connectionsData));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
printMessage('Any unique substring of a saved host can be used as the value for host parameter in all commands', 'info');
|
|
75
|
-
}
|
|
76
|
-
} catch (e) {
|
|
77
|
-
printMessage(`No connections found in ${filename} (${e.message})`, 'error');
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
149
|
/**
|
|
82
150
|
* Migrate from .frodorc to Connections.json
|
|
83
151
|
*/
|
|
@@ -103,10 +171,16 @@ function migrateFromLegacyProfile() {
|
|
|
103
171
|
*
|
|
104
172
|
* This method is called from app.ts and runs before any of the message handlers are registered.
|
|
105
173
|
* Therefore none of the Console message functions will produce any output.
|
|
174
|
+
* @param {State} state library state
|
|
106
175
|
*/
|
|
107
|
-
export async function initConnectionProfiles(
|
|
176
|
+
export async function initConnectionProfiles({
|
|
177
|
+
state
|
|
178
|
+
}) {
|
|
179
|
+
const dataProtection = new DataProtection(state.getMasterKeyPath());
|
|
108
180
|
// create connections.json file if it doesn't exist
|
|
109
|
-
const filename = getConnectionProfilesPath(
|
|
181
|
+
const filename = getConnectionProfilesPath({
|
|
182
|
+
state
|
|
183
|
+
});
|
|
110
184
|
const folderName = path.dirname(filename);
|
|
111
185
|
if (!fs.existsSync(folderName)) {
|
|
112
186
|
fs.mkdirSync(folderName, {
|
|
@@ -125,17 +199,17 @@ export async function initConnectionProfiles() {
|
|
|
125
199
|
for (const conn of Object.keys(connectionsData)) {
|
|
126
200
|
if (connectionsData[conn]['password']) {
|
|
127
201
|
convert = true;
|
|
128
|
-
connectionsData[conn].encodedPassword = await
|
|
202
|
+
connectionsData[conn].encodedPassword = await dataProtection.encrypt(connectionsData[conn]['password']);
|
|
129
203
|
delete connectionsData[conn]['password'];
|
|
130
204
|
}
|
|
131
205
|
if (connectionsData[conn]['logApiSecret']) {
|
|
132
206
|
convert = true;
|
|
133
|
-
connectionsData[conn].encodedLogApiSecret = await
|
|
207
|
+
connectionsData[conn].encodedLogApiSecret = await dataProtection.encrypt(connectionsData[conn]['logApiSecret']);
|
|
134
208
|
delete connectionsData[conn]['logApiSecret'];
|
|
135
209
|
}
|
|
136
210
|
if (connectionsData[conn]['svcacctJwk']) {
|
|
137
211
|
convert = true;
|
|
138
|
-
connectionsData[conn].encodedSvcacctJwk = await
|
|
212
|
+
connectionsData[conn].encodedSvcacctJwk = await dataProtection.encrypt(connectionsData[conn]['svcacctJwk']);
|
|
139
213
|
delete connectionsData[conn]['svcacctJwk'];
|
|
140
214
|
}
|
|
141
215
|
}
|
|
@@ -148,13 +222,23 @@ export async function initConnectionProfiles() {
|
|
|
148
222
|
/**
|
|
149
223
|
* Get connection profile by host
|
|
150
224
|
* @param {String} host host tenant host url or unique substring
|
|
225
|
+
* @param {State} state library state
|
|
151
226
|
* @returns {Object} connection profile or null
|
|
152
227
|
*/
|
|
153
|
-
export async function getConnectionProfileByHost(
|
|
228
|
+
export async function getConnectionProfileByHost({
|
|
229
|
+
host,
|
|
230
|
+
state
|
|
231
|
+
}) {
|
|
154
232
|
try {
|
|
155
|
-
const
|
|
233
|
+
const dataProtection = new DataProtection(state.getMasterKeyPath());
|
|
234
|
+
const filename = getConnectionProfilesPath({
|
|
235
|
+
state
|
|
236
|
+
});
|
|
156
237
|
const connectionsData = JSON.parse(fs.readFileSync(filename, 'utf8'));
|
|
157
|
-
const profiles = findConnectionProfiles(
|
|
238
|
+
const profiles = findConnectionProfiles({
|
|
239
|
+
connectionProfiles: connectionsData,
|
|
240
|
+
host
|
|
241
|
+
});
|
|
158
242
|
if (profiles.length == 0) {
|
|
159
243
|
printMessage(`Profile for ${host} not found. Please specify credentials on command line`, 'error');
|
|
160
244
|
return null;
|
|
@@ -170,14 +254,14 @@ export async function getConnectionProfileByHost(host) {
|
|
|
170
254
|
return {
|
|
171
255
|
tenant: profiles[0].tenant,
|
|
172
256
|
username: profiles[0].username ? profiles[0].username : null,
|
|
173
|
-
password: profiles[0].encodedPassword ? await
|
|
257
|
+
password: profiles[0].encodedPassword ? await dataProtection.decrypt(profiles[0].encodedPassword) : null,
|
|
174
258
|
logApiKey: profiles[0].logApiKey ? profiles[0].logApiKey : null,
|
|
175
|
-
logApiSecret: profiles[0].encodedLogApiSecret ? await
|
|
259
|
+
logApiSecret: profiles[0].encodedLogApiSecret ? await dataProtection.decrypt(profiles[0].encodedLogApiSecret) : null,
|
|
176
260
|
authenticationService: profiles[0].authenticationService ? profiles[0].authenticationService : null,
|
|
177
261
|
authenticationHeaderOverrides: profiles[0].authenticationHeaderOverrides ? profiles[0].authenticationHeaderOverrides : {},
|
|
178
262
|
svcacctName: profiles[0].svcacctName ? profiles[0].svcacctName : null,
|
|
179
263
|
svcacctId: profiles[0].svcacctId ? profiles[0].svcacctId : null,
|
|
180
|
-
svcacctJwk: profiles[0].encodedSvcacctJwk ? await
|
|
264
|
+
svcacctJwk: profiles[0].encodedSvcacctJwk ? await dataProtection.decrypt(profiles[0].encodedSvcacctJwk) : null
|
|
181
265
|
};
|
|
182
266
|
} catch (e) {
|
|
183
267
|
printMessage(`Can not read saved connection info, please specify credentials on command line: ${e}`, 'error');
|
|
@@ -189,8 +273,13 @@ export async function getConnectionProfileByHost(host) {
|
|
|
189
273
|
* Get connection profile
|
|
190
274
|
* @returns {Object} connection profile or null
|
|
191
275
|
*/
|
|
192
|
-
export async function getConnectionProfile(
|
|
193
|
-
|
|
276
|
+
export async function getConnectionProfile({
|
|
277
|
+
state
|
|
278
|
+
}) {
|
|
279
|
+
return getConnectionProfileByHost({
|
|
280
|
+
host: state.getHost(),
|
|
281
|
+
state
|
|
282
|
+
});
|
|
194
283
|
}
|
|
195
284
|
|
|
196
285
|
/**
|
|
@@ -198,9 +287,15 @@ export async function getConnectionProfile() {
|
|
|
198
287
|
* @param {string} host host url for new profiles or unique substring for existing profiles
|
|
199
288
|
* @returns {Promise<boolean>} true if the operation succeeded, false otherwise
|
|
200
289
|
*/
|
|
201
|
-
export async function saveConnectionProfile(
|
|
290
|
+
export async function saveConnectionProfile({
|
|
291
|
+
host,
|
|
292
|
+
state
|
|
293
|
+
}) {
|
|
202
294
|
debugMessage(`ConnectionProfileOps.saveConnectionProfile: start`);
|
|
203
|
-
const
|
|
295
|
+
const dataProtection = new DataProtection(state.getMasterKeyPath());
|
|
296
|
+
const filename = getConnectionProfilesPath({
|
|
297
|
+
state
|
|
298
|
+
});
|
|
204
299
|
debugMessage(`Saving connection profile in ${filename}`);
|
|
205
300
|
let profiles = {};
|
|
206
301
|
let profile = {
|
|
@@ -212,7 +307,10 @@ export async function saveConnectionProfile(host) {
|
|
|
212
307
|
profiles = JSON.parse(data);
|
|
213
308
|
|
|
214
309
|
// find tenant
|
|
215
|
-
const found = findConnectionProfiles(
|
|
310
|
+
const found = findConnectionProfiles({
|
|
311
|
+
connectionProfiles: profiles,
|
|
312
|
+
host
|
|
313
|
+
});
|
|
216
314
|
|
|
217
315
|
// replace tenant in session with real tenant url if necessary
|
|
218
316
|
if (found.length === 1) {
|
|
@@ -239,21 +337,27 @@ export async function saveConnectionProfile(host) {
|
|
|
239
337
|
|
|
240
338
|
// user account
|
|
241
339
|
if (state.getUsername()) profile.username = state.getUsername();
|
|
242
|
-
if (state.getPassword()) profile.encodedPassword = await
|
|
340
|
+
if (state.getPassword()) profile.encodedPassword = await dataProtection.encrypt(state.getPassword());
|
|
243
341
|
|
|
244
342
|
// log API
|
|
245
343
|
if (state.getLogApiKey()) profile.logApiKey = state.getLogApiKey();
|
|
246
|
-
if (state.getLogApiSecret()) profile.encodedLogApiSecret = await
|
|
344
|
+
if (state.getLogApiSecret()) profile.encodedLogApiSecret = await dataProtection.encrypt(state.getLogApiSecret());
|
|
247
345
|
|
|
248
346
|
// service account
|
|
249
347
|
if (state.getServiceAccountId()) {
|
|
250
348
|
profile.svcacctId = state.getServiceAccountId();
|
|
251
|
-
profile.svcacctName = (await getServiceAccount(
|
|
349
|
+
profile.svcacctName = (await getServiceAccount({
|
|
350
|
+
serviceAccountId: state.getServiceAccountId(),
|
|
351
|
+
state
|
|
352
|
+
})).name;
|
|
252
353
|
}
|
|
253
|
-
if (state.getServiceAccountJwk()) profile.encodedSvcacctJwk = await
|
|
354
|
+
if (state.getServiceAccountJwk()) profile.encodedSvcacctJwk = await dataProtection.encrypt(state.getServiceAccountJwk());
|
|
254
355
|
// update existing service account profile
|
|
255
356
|
if (profile.svcacctId && !profile.svcacctName) {
|
|
256
|
-
profile.svcacctName = (await getServiceAccount(
|
|
357
|
+
profile.svcacctName = (await getServiceAccount({
|
|
358
|
+
serviceAccountId: profile.svcacctId,
|
|
359
|
+
state
|
|
360
|
+
})).name;
|
|
257
361
|
debugMessage(`ConnectionProfileOps.saveConnectionProfile: added missing service account name`);
|
|
258
362
|
}
|
|
259
363
|
|
|
@@ -281,7 +385,12 @@ export async function saveConnectionProfile(host) {
|
|
|
281
385
|
}, {});
|
|
282
386
|
|
|
283
387
|
// save profiles
|
|
284
|
-
saveJsonToFile(
|
|
388
|
+
saveJsonToFile({
|
|
389
|
+
data: orderedProfiles,
|
|
390
|
+
filename,
|
|
391
|
+
includeMeta: false,
|
|
392
|
+
state
|
|
393
|
+
});
|
|
285
394
|
verboseMessage(`Saved connection profile ${state.getHost()} in ${filename}`);
|
|
286
395
|
debugMessage(`ConnectionProfileOps.saveConnectionProfile: end [true]`);
|
|
287
396
|
return true;
|
|
@@ -291,14 +400,22 @@ export async function saveConnectionProfile(host) {
|
|
|
291
400
|
* Delete connection profile
|
|
292
401
|
* @param {String} host host tenant host url or unique substring
|
|
293
402
|
*/
|
|
294
|
-
export function deleteConnectionProfile(
|
|
295
|
-
|
|
403
|
+
export function deleteConnectionProfile({
|
|
404
|
+
host,
|
|
405
|
+
state
|
|
406
|
+
}) {
|
|
407
|
+
const filename = getConnectionProfilesPath({
|
|
408
|
+
state
|
|
409
|
+
});
|
|
296
410
|
let connectionsData = {};
|
|
297
411
|
fs.stat(filename, err => {
|
|
298
412
|
if (err == null) {
|
|
299
413
|
const data = fs.readFileSync(filename, 'utf8');
|
|
300
414
|
connectionsData = JSON.parse(data);
|
|
301
|
-
const profiles = findConnectionProfiles(
|
|
415
|
+
const profiles = findConnectionProfiles({
|
|
416
|
+
connectionProfiles: connectionsData,
|
|
417
|
+
host
|
|
418
|
+
});
|
|
302
419
|
if (profiles.length == 1) {
|
|
303
420
|
delete connectionsData[profiles[0].tenant];
|
|
304
421
|
fs.writeFileSync(filename, JSON.stringify(connectionsData, null, 2));
|
|
@@ -323,70 +440,13 @@ export function deleteConnectionProfile(host) {
|
|
|
323
440
|
});
|
|
324
441
|
}
|
|
325
442
|
|
|
326
|
-
/**
|
|
327
|
-
* Describe connection profile
|
|
328
|
-
* @param {string} host Host URL or unique substring
|
|
329
|
-
* @param {boolean} showSecrets Whether secrets should be shown in clear text or not
|
|
330
|
-
*/
|
|
331
|
-
export async function describeConnectionProfile(host, showSecrets) {
|
|
332
|
-
debugMessage(`ConnectionProfileOps.describeConnectionProfile: start`);
|
|
333
|
-
const profile = await getConnectionProfileByHost(host);
|
|
334
|
-
if (profile) {
|
|
335
|
-
debugMessage(profile);
|
|
336
|
-
const present = '[present]';
|
|
337
|
-
const jwk = profile.svcacctJwk;
|
|
338
|
-
if (!showSecrets) {
|
|
339
|
-
if (profile.password) profile.password = present;
|
|
340
|
-
if (profile.logApiSecret) profile.logApiSecret = present;
|
|
341
|
-
if (profile.svcacctJwk) profile['svcacctJwk'] = present;
|
|
342
|
-
}
|
|
343
|
-
if (!profile.username) {
|
|
344
|
-
delete profile.username;
|
|
345
|
-
delete profile.password;
|
|
346
|
-
}
|
|
347
|
-
if (!profile.logApiKey) {
|
|
348
|
-
delete profile.logApiKey;
|
|
349
|
-
delete profile.logApiSecret;
|
|
350
|
-
}
|
|
351
|
-
if (!profile.svcacctId) {
|
|
352
|
-
delete profile.svcacctId;
|
|
353
|
-
delete profile.svcacctJwk;
|
|
354
|
-
delete profile.svcacctName;
|
|
355
|
-
}
|
|
356
|
-
if (showSecrets && jwk) {
|
|
357
|
-
profile['svcacctJwk'] = 'see below';
|
|
358
|
-
}
|
|
359
|
-
if (!profile.authenticationService) {
|
|
360
|
-
delete profile.authenticationService;
|
|
361
|
-
}
|
|
362
|
-
const keyMap = {
|
|
363
|
-
tenant: 'Host',
|
|
364
|
-
username: 'Username',
|
|
365
|
-
password: 'Password',
|
|
366
|
-
logApiKey: 'Log API Key',
|
|
367
|
-
logApiSecret: 'Log API Secret',
|
|
368
|
-
authenticationService: 'Authentication Service',
|
|
369
|
-
authenticationHeaderOverrides: 'Authentication Header Overrides',
|
|
370
|
-
svcacctName: 'Service Account Name',
|
|
371
|
-
svcacctId: 'Service Account Id',
|
|
372
|
-
svcacctJwk: 'Service Account JWK'
|
|
373
|
-
};
|
|
374
|
-
const table = createObjectTable(profile, keyMap);
|
|
375
|
-
printMessage(table.toString(), 'data');
|
|
376
|
-
if (showSecrets && jwk) {
|
|
377
|
-
printMessage(jwk, 'data');
|
|
378
|
-
}
|
|
379
|
-
} else {
|
|
380
|
-
printMessage(`No connection profile ${host} found`);
|
|
381
|
-
}
|
|
382
|
-
debugMessage(`ConnectionProfileOps.describeConnectionProfile: end`);
|
|
383
|
-
}
|
|
384
|
-
|
|
385
443
|
/**
|
|
386
444
|
* Create a new service account using auto-generated parameters
|
|
387
445
|
* @returns {Promise<IdObjectSkeletonInterface>} A promise resolving to a service account object
|
|
388
446
|
*/
|
|
389
|
-
export async function addNewServiceAccount(
|
|
447
|
+
export async function addNewServiceAccount({
|
|
448
|
+
state
|
|
449
|
+
}) {
|
|
390
450
|
debugMessage(`ConnectionProfileOps.addNewServiceAccount: start`);
|
|
391
451
|
const name = `Frodo-SA-${new Date().getTime()}`;
|
|
392
452
|
debugMessage(`ConnectionProfileOps.addNewServiceAccount: name=${name}...`);
|
|
@@ -395,7 +455,14 @@ export async function addNewServiceAccount() {
|
|
|
395
455
|
const jwkPrivate = await createJwkRsa();
|
|
396
456
|
const jwkPublic = await getJwkRsaPublic(jwkPrivate);
|
|
397
457
|
const jwks = createJwks(jwkPublic);
|
|
398
|
-
const sa = await createServiceAccount(
|
|
458
|
+
const sa = await createServiceAccount({
|
|
459
|
+
name,
|
|
460
|
+
description,
|
|
461
|
+
accountStatus: 'Active',
|
|
462
|
+
scopes: scope,
|
|
463
|
+
jwks,
|
|
464
|
+
state
|
|
465
|
+
});
|
|
399
466
|
debugMessage(`ConnectionProfileOps.addNewServiceAccount: id=${sa._id}`);
|
|
400
467
|
state.setServiceAccountId(sa._id);
|
|
401
468
|
state.setServiceAccountJwk(jwkPrivate);
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run tests
|
|
3
|
+
*
|
|
4
|
+
* npm run test:only ConnectionProfileOps
|
|
5
|
+
*
|
|
6
|
+
* Note: FRODO_DEBUG=1 is optional and enables debug logging for some output
|
|
7
|
+
* in case things don't function as expected
|
|
8
|
+
*/
|
|
1
9
|
import fs from 'fs';
|
|
2
10
|
import { homedir } from 'os';
|
|
3
|
-
import {
|
|
11
|
+
import { state } from '../index';
|
|
12
|
+
import * as ConnectionProfileOps from './ConnectionProfileOps';
|
|
4
13
|
import { FRODO_CONNECTION_PROFILES_PATH_KEY, FRODO_MASTER_KEY_PATH_KEY, FRODO_MASTER_KEY_KEY } from '../storage/StaticStorage';
|
|
5
14
|
describe('ConnectionProfileOps', () => {
|
|
6
15
|
const connectionProfilePath1 = `${homedir()}/connections1.json`;
|
|
@@ -53,7 +62,10 @@ describe('ConnectionProfileOps', () => {
|
|
|
53
62
|
state.setUsername(user);
|
|
54
63
|
state.setPassword(password);
|
|
55
64
|
state.setConnectionProfilesPath(connectionProfilePath1);
|
|
56
|
-
await
|
|
65
|
+
await ConnectionProfileOps.saveConnectionProfile({
|
|
66
|
+
host,
|
|
67
|
+
state
|
|
68
|
+
});
|
|
57
69
|
expect(fs.existsSync(connectionProfilePath1)).toBeTruthy();
|
|
58
70
|
const connections = JSON.parse(fs.readFileSync(connectionProfilePath1, 'utf8'));
|
|
59
71
|
expect(connections).toBeTruthy();
|
|
@@ -71,8 +83,13 @@ describe('ConnectionProfileOps', () => {
|
|
|
71
83
|
state.setUsername(user);
|
|
72
84
|
state.setPassword(password);
|
|
73
85
|
state.setConnectionProfilesPath('');
|
|
74
|
-
await
|
|
75
|
-
|
|
86
|
+
await ConnectionProfileOps.saveConnectionProfile({
|
|
87
|
+
host,
|
|
88
|
+
state
|
|
89
|
+
});
|
|
90
|
+
expect(ConnectionProfileOps.getConnectionProfilesPath({
|
|
91
|
+
state
|
|
92
|
+
})).toEqual(connectionProfilePath2);
|
|
76
93
|
expect(fs.existsSync(connectionProfilePath2)).toBeTruthy();
|
|
77
94
|
const connections = JSON.parse(fs.readFileSync(connectionProfilePath2, 'utf8'));
|
|
78
95
|
expect(connections).toBeTruthy();
|
|
@@ -91,7 +108,10 @@ describe('ConnectionProfileOps', () => {
|
|
|
91
108
|
state.setUsername(user);
|
|
92
109
|
state.setPassword(password);
|
|
93
110
|
state.setConnectionProfilesPath(connectionProfilePath3);
|
|
94
|
-
await
|
|
111
|
+
await ConnectionProfileOps.saveConnectionProfile({
|
|
112
|
+
host,
|
|
113
|
+
state
|
|
114
|
+
});
|
|
95
115
|
expect(fs.existsSync(connectionProfilePath3)).toBeTruthy();
|
|
96
116
|
const connections = JSON.parse(fs.readFileSync(connectionProfilePath3, 'utf8'));
|
|
97
117
|
expect(connections).toBeTruthy();
|
|
@@ -1,4 +1,45 @@
|
|
|
1
1
|
import { getConfigEntitiesByType, getConfigEntity, putConfigEntity } from '../api/IdmConfigApi';
|
|
2
|
+
export default class EmailTemplateOps {
|
|
3
|
+
constructor(state) {
|
|
4
|
+
this.state = state;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Get all email templates
|
|
9
|
+
* @returns {Promise} a promise that resolves to an array of email template objects
|
|
10
|
+
*/
|
|
11
|
+
async getEmailTemplates() {
|
|
12
|
+
return getEmailTemplates({
|
|
13
|
+
state: this.state
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Get email template
|
|
19
|
+
* @param {string} templateId id/name of the email template without the type prefix
|
|
20
|
+
* @returns {Promise} a promise that resolves an email template object
|
|
21
|
+
*/
|
|
22
|
+
async getEmailTemplate(templateId) {
|
|
23
|
+
return getEmailTemplate({
|
|
24
|
+
templateId,
|
|
25
|
+
state: this.state
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Put email template
|
|
31
|
+
* @param {string} templateId id/name of the email template without the type prefix
|
|
32
|
+
* @param {Object} templateData email template object
|
|
33
|
+
* @returns {Promise} a promise that resolves to an email template object
|
|
34
|
+
*/
|
|
35
|
+
async putEmailTemplate(templateId, templateData) {
|
|
36
|
+
return putEmailTemplate({
|
|
37
|
+
templateId,
|
|
38
|
+
templateData,
|
|
39
|
+
state: this.state
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
2
43
|
|
|
3
44
|
/**
|
|
4
45
|
* Email template type key used to build the IDM id: 'emailTemplate/<id>'
|
|
@@ -9,8 +50,13 @@ export const EMAIL_TEMPLATE_TYPE = 'emailTemplate';
|
|
|
9
50
|
* Get all email templates
|
|
10
51
|
* @returns {Promise} a promise that resolves to an array of email template objects
|
|
11
52
|
*/
|
|
12
|
-
export async function getEmailTemplates(
|
|
13
|
-
|
|
53
|
+
export async function getEmailTemplates({
|
|
54
|
+
state
|
|
55
|
+
}) {
|
|
56
|
+
return getConfigEntitiesByType({
|
|
57
|
+
type: EMAIL_TEMPLATE_TYPE,
|
|
58
|
+
state
|
|
59
|
+
});
|
|
14
60
|
}
|
|
15
61
|
|
|
16
62
|
/**
|
|
@@ -18,8 +64,14 @@ export async function getEmailTemplates() {
|
|
|
18
64
|
* @param {string} templateId id/name of the email template without the type prefix
|
|
19
65
|
* @returns {Promise} a promise that resolves an email template object
|
|
20
66
|
*/
|
|
21
|
-
export async function getEmailTemplate(
|
|
22
|
-
|
|
67
|
+
export async function getEmailTemplate({
|
|
68
|
+
templateId,
|
|
69
|
+
state
|
|
70
|
+
}) {
|
|
71
|
+
return getConfigEntity({
|
|
72
|
+
entityId: `${EMAIL_TEMPLATE_TYPE}/${templateId}`,
|
|
73
|
+
state
|
|
74
|
+
});
|
|
23
75
|
}
|
|
24
76
|
|
|
25
77
|
/**
|
|
@@ -28,7 +80,15 @@ export async function getEmailTemplate(templateId) {
|
|
|
28
80
|
* @param {Object} templateData email template object
|
|
29
81
|
* @returns {Promise} a promise that resolves to an email template object
|
|
30
82
|
*/
|
|
31
|
-
export async function putEmailTemplate(
|
|
32
|
-
|
|
83
|
+
export async function putEmailTemplate({
|
|
84
|
+
templateId,
|
|
85
|
+
templateData,
|
|
86
|
+
state
|
|
87
|
+
}) {
|
|
88
|
+
return putConfigEntity({
|
|
89
|
+
entityId: `${EMAIL_TEMPLATE_TYPE}/${templateId}`,
|
|
90
|
+
entityData: templateData,
|
|
91
|
+
state
|
|
92
|
+
});
|
|
33
93
|
}
|
|
34
94
|
//# sourceMappingURL=EmailTemplateOps.js.map
|