@catladder/cli 3.46.0 → 3.46.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/babel-inline.json +11 -0
- package/dist/bundles/catenv/index.js +2 -2
- package/dist/bundles/cli/index.js +1 -1
- package/dist/cli/src/apps/catci/catci.d.ts +1 -1
- package/dist/cli/src/apps/catci/catci.js +23 -20
- package/dist/cli/src/apps/catci/commands/security/auditDocument.d.ts +16 -16
- package/dist/cli/src/apps/catci/commands/security/auditDocument.js +54 -65
- package/dist/cli/src/apps/catci/commands/security/commands.d.ts +1 -1
- package/dist/cli/src/apps/catci/commands/security/commands.js +91 -83
- package/dist/cli/src/apps/catci/commands/security/createSecurityAuditMergeRequest.d.ts +11 -6
- package/dist/cli/src/apps/catci/commands/security/createSecurityAuditMergeRequest.js +43 -43
- package/dist/cli/src/apps/catci/commands/security/evaluateSecurityAudit.d.ts +5 -3
- package/dist/cli/src/apps/catci/commands/security/evaluateSecurityAudit.js +16 -12
- package/dist/cli/src/apps/catenv/catenv.d.ts +2 -2
- package/dist/cli/src/apps/catenv/catenv.js +15 -18
- package/dist/cli/src/apps/catenv/printVariables.d.ts +1 -1
- package/dist/cli/src/apps/catenv/printVariables.js +42 -39
- package/dist/cli/src/apps/catenv/types.d.ts +3 -3
- package/dist/cli/src/apps/catenv/types.js +4 -2
- package/dist/cli/src/apps/catenv/utils.d.ts +9 -6
- package/dist/cli/src/apps/catenv/utils.js +25 -21
- package/dist/cli/src/apps/catenv/verboseBanner.d.ts +1 -1
- package/dist/cli/src/apps/catenv/verboseBanner.js +20 -24
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.d.ts +1 -1
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js +25 -22
- package/dist/cli/src/apps/catenv/writeEnvDTs.d.ts +1 -1
- package/dist/cli/src/apps/catenv/writeEnvDTs.js +31 -32
- package/dist/cli/src/apps/cli/cli.d.ts +1 -1
- package/dist/cli/src/apps/cli/cli.js +23 -24
- package/dist/cli/src/apps/cli/commands/cloudSQL/commandRestoreDb.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/cloudSQL/commandRestoreDb.js +122 -103
- package/dist/cli/src/apps/cli/commands/cloudSQL/index.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/cloudSQL/index.js +11 -7
- package/dist/cli/src/apps/cli/commands/general/index.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/general/index.js +67 -62
- package/dist/cli/src/apps/cli/commands/general/namespaceAutoCompletion.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/general/namespaceAutoCompletion.js +9 -7
- package/dist/cli/src/apps/cli/commands/general/portForward.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/general/portForward.js +42 -35
- package/dist/cli/src/apps/cli/commands/mongodb/index.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/index.js +13 -9
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoDestroyMember.js +83 -81
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoGetShell.js +31 -29
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoPortForward.js +54 -47
- package/dist/cli/src/apps/cli/commands/mongodb/utils/index.d.ts +6 -6
- package/dist/cli/src/apps/cli/commands/mongodb/utils/index.js +56 -52
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js +140 -140
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js +106 -107
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js +109 -124
- package/dist/cli/src/apps/cli/commands/project/commandDeletePods.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandDeletePods.js +45 -38
- package/dist/cli/src/apps/cli/commands/project/commandDeleteProject.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandDeleteProject.js +28 -23
- package/dist/cli/src/apps/cli/commands/project/commandEnvVars.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandEnvVars.js +14 -10
- package/dist/cli/src/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandGetMyTotalWorktime.js +9 -9
- package/dist/cli/src/apps/cli/commands/project/commandGetShell.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandGetShell.js +29 -26
- package/dist/cli/src/apps/cli/commands/project/commandGitlabCi.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandGitlabCi.js +71 -69
- package/dist/cli/src/apps/cli/commands/project/commandListPods.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandListPods.js +15 -12
- package/dist/cli/src/apps/cli/commands/project/commandNamespace.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandNamespace.js +9 -8
- package/dist/cli/src/apps/cli/commands/project/commandOpenEnv.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenEnv.js +20 -14
- package/dist/cli/src/apps/cli/commands/project/commandOpenGit.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenGit.js +7 -7
- package/dist/cli/src/apps/cli/commands/project/commandOpenLogs.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenLogs.js +14 -10
- package/dist/cli/src/apps/cli/commands/project/commandPauseProject.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandPauseProject.js +28 -23
- package/dist/cli/src/apps/cli/commands/project/commandPortForward.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandPortForward.js +80 -63
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.js +7 -7
- package/dist/cli/src/apps/cli/commands/project/commandSecretsClearBackups.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandSecretsClearBackups.js +17 -16
- package/dist/cli/src/apps/cli/commands/project/commandSecurityEvaluate.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandSecurityEvaluate.js +16 -15
- package/dist/cli/src/apps/cli/commands/project/commandSetup.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandSetup.js +9 -8
- package/dist/cli/src/apps/cli/commands/project/commandTriggerCronjob.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandTriggerCronjob.js +51 -44
- package/dist/cli/src/apps/cli/commands/project/index.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/index.js +31 -27
- package/dist/cli/src/apps/cli/commands/project/setup/index.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/index.js +25 -29
- package/dist/cli/src/apps/cli/commands/project/setup/logSection.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/logSection.js +15 -13
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js +40 -31
- package/dist/cli/src/apps/cli/commands/project/setup/setupAgents.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupAgents.js +137 -130
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js +42 -47
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js +15 -13
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js +70 -69
- package/dist/cli/src/apps/cli/commands/project/setup/setupTopic.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupTopic.js +15 -7
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.js +21 -16
- package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js +33 -27
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js +35 -30
- package/dist/cli/src/apps/cli/commands/project/utils/showProjectBanner.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/showProjectBanner.js +12 -10
- package/dist/cli/src/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +1 -1
- package/dist/cli/src/apps/cli/commands/theStuffThatReallyMatters/index.js +31 -29
- package/dist/cli/src/apps/cli/utils/getGoogleAuthUserNumber.d.ts +1 -1
- package/dist/cli/src/apps/cli/utils/getGoogleAuthUserNumber.js +18 -14
- package/dist/cli/src/apps/cli/verify/index.d.ts +1 -1
- package/dist/cli/src/apps/cli/verify/index.js +13 -11
- package/dist/cli/src/catci.d.ts +1 -1
- package/dist/cli/src/catci.js +5 -3
- package/dist/cli/src/catenv.d.ts +1 -1
- package/dist/cli/src/catenv.js +20 -14
- package/dist/cli/src/cli.d.ts +1 -1
- package/dist/cli/src/cli.js +9 -5
- package/dist/cli/src/config/getProjectConfig.d.ts +8 -6
- package/dist/cli/src/config/getProjectConfig.js +93 -91
- package/dist/cli/src/config/parseChoice.d.ts +3 -3
- package/dist/cli/src/config/parseChoice.js +11 -6
- package/dist/cli/src/gcloud/artifactsRegistry.d.ts +3 -3
- package/dist/cli/src/gcloud/artifactsRegistry.js +12 -11
- package/dist/cli/src/gcloud/cloudRun/getCloudRunDomainSuffix.d.ts +1 -1
- package/dist/cli/src/gcloud/cloudRun/getCloudRunDomainSuffix.js +23 -22
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.d.ts +1 -1
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js +19 -12
- package/dist/cli/src/gcloud/cloudSql/copyDb.d.ts +9 -9
- package/dist/cli/src/gcloud/cloudSql/copyDb.js +27 -16
- package/dist/cli/src/gcloud/cloudSql/parseConnectionString.d.ts +1 -1
- package/dist/cli/src/gcloud/cloudSql/parseConnectionString.js +12 -10
- package/dist/cli/src/gcloud/cloudSql/startProxy.d.ts +4 -4
- package/dist/cli/src/gcloud/cloudSql/startProxy.js +55 -39
- package/dist/cli/src/gcloud/enableServices.d.ts +2 -2
- package/dist/cli/src/gcloud/enableServices.js +8 -6
- package/dist/cli/src/gcloud/openDashboard.d.ts +1 -1
- package/dist/cli/src/gcloud/openDashboard.js +17 -13
- package/dist/cli/src/gcloud/serviceAccounts.d.ts +6 -6
- package/dist/cli/src/gcloud/serviceAccounts.js +64 -58
- package/dist/cli/src/git/getGetMainBranch.d.ts +1 -1
- package/dist/cli/src/git/getGetMainBranch.js +9 -5
- package/dist/cli/src/git/gitConfig.d.ts +11 -6
- package/dist/cli/src/git/gitConfig.js +17 -11
- package/dist/cli/src/git/gitProjectInformation.d.ts +6 -6
- package/dist/cli/src/git/gitProjectInformation.js +30 -20
- package/dist/cli/src/git/index.d.ts +1 -1
- package/dist/cli/src/git/index.js +23 -16
- package/dist/cli/src/index.d.ts +1 -1
- package/dist/cli/src/index.js +4 -2
- package/dist/cli/src/k8sApi/index.d.ts +1 -1
- package/dist/cli/src/k8sApi/index.js +14 -12
- package/dist/cli/src/kubernetes/index.d.ts +1 -1
- package/dist/cli/src/kubernetes/index.js +24 -17
- package/dist/cli/src/kubernetes/openKubernetesDashboards.d.ts +1 -1
- package/dist/cli/src/kubernetes/openKubernetesDashboards.js +35 -33
- package/dist/cli/src/kubernetes/portForward.d.ts +1 -1
- package/dist/cli/src/kubernetes/portForward.js +7 -5
- package/dist/cli/src/packageInfos.d.ts +1 -1
- package/dist/cli/src/packageInfos.js +5 -3
- package/dist/cli/src/types/types.d.ts +13 -13
- package/dist/cli/src/types/types.js +4 -2
- package/dist/cli/src/utils/boxWithAscii.d.ts +1 -1
- package/dist/cli/src/utils/boxWithAscii.js +12 -10
- package/dist/cli/src/utils/cluster.d.ts +1 -1
- package/dist/cli/src/utils/cluster.js +8 -6
- package/dist/cli/src/utils/editAsFile.d.ts +1 -1
- package/dist/cli/src/utils/editAsFile.js +25 -17
- package/dist/cli/src/utils/files.d.ts +1 -1
- package/dist/cli/src/utils/files.js +15 -12
- package/dist/cli/src/utils/getEditor.d.ts +2 -2
- package/dist/cli/src/utils/getEditor.js +20 -14
- package/dist/cli/src/utils/gitlab.d.ts +9 -9
- package/dist/cli/src/utils/gitlab.js +188 -166
- package/dist/cli/src/utils/log.d.ts +2 -2
- package/dist/cli/src/utils/log.js +18 -16
- package/dist/cli/src/utils/portForwards.d.ts +5 -5
- package/dist/cli/src/utils/portForwards.js +32 -31
- package/dist/cli/src/utils/preferences.d.ts +1 -1
- package/dist/cli/src/utils/preferences.js +43 -36
- package/dist/cli/src/utils/projects/index.d.ts +1 -1
- package/dist/cli/src/utils/projects/index.js +24 -21
- package/dist/cli/src/utils/promise.d.ts +1 -1
- package/dist/cli/src/utils/promise.js +8 -6
- package/dist/cli/src/utils/shell.d.ts +1 -1
- package/dist/cli/src/utils/shell.js +20 -19
- package/dist/pipeline/src/bash/BashExpression.d.ts +18 -18
- package/dist/pipeline/src/bash/BashExpression.js +44 -45
- package/dist/pipeline/src/bash/bashEscape.d.ts +6 -4
- package/dist/pipeline/src/bash/bashEscape.js +63 -73
- package/dist/pipeline/src/bash/bashExpressionPerPipelineType.d.ts +3 -5
- package/dist/pipeline/src/bash/bashExpressionPerPipelineType.js +7 -6
- package/dist/pipeline/src/bash/bashYaml.d.ts +1 -1
- package/dist/pipeline/src/bash/bashYaml.js +41 -46
- package/dist/pipeline/src/bash/getInjectVarsScript.d.ts +1 -1
- package/dist/pipeline/src/bash/getInjectVarsScript.js +11 -14
- package/dist/pipeline/src/bash/index.d.ts +1 -1
- package/dist/pipeline/src/bash/index.js +23 -16
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.d.ts +1 -1
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js +41 -50
- package/dist/pipeline/src/build/base/constants.d.ts +4 -4
- package/dist/pipeline/src/build/base/constants.js +8 -6
- package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +7 -1
- package/dist/pipeline/src/build/base/createAppBuildJob.js +37 -43
- package/dist/pipeline/src/build/base/createArtifactsConfig.d.ts +1 -1
- package/dist/pipeline/src/build/base/createArtifactsConfig.js +16 -25
- package/dist/pipeline/src/build/base/createBuildJobDefinition.d.ts +3 -3
- package/dist/pipeline/src/build/base/createBuildJobDefinition.js +16 -22
- package/dist/pipeline/src/build/base/index.d.ts +4 -4
- package/dist/pipeline/src/build/base/index.js +15 -34
- package/dist/pipeline/src/build/base/writeBuildInfo.d.ts +1 -1
- package/dist/pipeline/src/build/base/writeBuildInfo.js +7 -7
- package/dist/pipeline/src/build/base/writeDotEnv.d.ts +1 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js +19 -21
- package/dist/pipeline/src/build/cache/createJobCache.d.ts +1 -1
- package/dist/pipeline/src/build/cache/createJobCache.js +47 -49
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.d.ts +1 -1
- package/dist/pipeline/src/build/cache/getAllCacheConfigsFromConfig.js +16 -23
- package/dist/pipeline/src/build/cache/transformLegacyJobCache.d.ts +1 -1
- package/dist/pipeline/src/build/cache/transformLegacyJobCache.js +14 -12
- package/dist/pipeline/src/build/custom/buildJob.d.ts +1 -1
- package/dist/pipeline/src/build/custom/buildJob.js +16 -16
- package/dist/pipeline/src/build/custom/index.d.ts +1 -1
- package/dist/pipeline/src/build/custom/index.js +7 -5
- package/dist/pipeline/src/build/custom/testJob.d.ts +2 -2
- package/dist/pipeline/src/build/custom/testJob.js +67 -71
- package/dist/pipeline/src/build/docker.d.ts +49 -45
- package/dist/pipeline/src/build/docker.js +104 -129
- package/dist/pipeline/src/build/index.d.ts +13 -17
- package/dist/pipeline/src/build/index.js +80 -73
- package/dist/pipeline/src/build/node/buildJob.d.ts +1 -1
- package/dist/pipeline/src/build/node/buildJob.js +34 -37
- package/dist/pipeline/src/build/node/cache.d.ts +1 -1
- package/dist/pipeline/src/build/node/cache.js +34 -56
- package/dist/pipeline/src/build/node/constants.d.ts +4 -4
- package/dist/pipeline/src/build/node/constants.js +8 -6
- package/dist/pipeline/src/build/node/index.d.ts +1 -1
- package/dist/pipeline/src/build/node/index.js +11 -9
- package/dist/pipeline/src/build/node/meteor.d.ts +1 -1
- package/dist/pipeline/src/build/node/meteor.js +39 -54
- package/dist/pipeline/src/build/node/testJob.d.ts +1 -1
- package/dist/pipeline/src/build/node/testJob.js +71 -93
- package/dist/pipeline/src/build/node/yarn.d.ts +2 -2
- package/dist/pipeline/src/build/node/yarn.js +28 -47
- package/dist/pipeline/src/build/rails/build.d.ts +1 -1
- package/dist/pipeline/src/build/rails/build.js +37 -44
- package/dist/pipeline/src/build/rails/index.d.ts +1 -1
- package/dist/pipeline/src/build/rails/index.js +7 -5
- package/dist/pipeline/src/build/rails/testJob.d.ts +1 -1
- package/dist/pipeline/src/build/rails/testJob.js +71 -101
- package/dist/pipeline/src/build/types.d.ts +294 -294
- package/dist/pipeline/src/build/types.js +10 -10
- package/dist/pipeline/src/catenv/index.d.ts +3 -3
- package/dist/pipeline/src/catenv/index.js +10 -8
- package/dist/pipeline/src/config/configruedEnvs.d.ts +1 -1
- package/dist/pipeline/src/config/configruedEnvs.js +18 -23
- package/dist/pipeline/src/config/index.d.ts +1 -1
- package/dist/pipeline/src/config/index.js +23 -16
- package/dist/pipeline/src/config/readConfig.d.ts +4 -4
- package/dist/pipeline/src/config/readConfig.js +34 -32
- package/dist/pipeline/src/constants.d.ts +1 -1
- package/dist/pipeline/src/constants.js +6 -5
- package/dist/pipeline/src/context/createAllComponentsContext.d.ts +8 -4
- package/dist/pipeline/src/context/createAllComponentsContext.js +22 -16
- package/dist/pipeline/src/context/createComponentContext.d.ts +6 -6
- package/dist/pipeline/src/context/createComponentContext.js +87 -96
- package/dist/pipeline/src/context/createWorkspaceContext.d.ts +15 -8
- package/dist/pipeline/src/context/createWorkspaceContext.js +37 -28
- package/dist/pipeline/src/context/getBuildInfoVariables.d.ts +2 -2
- package/dist/pipeline/src/context/getBuildInfoVariables.js +22 -21
- package/dist/pipeline/src/context/getEnvConfig.d.ts +1 -1
- package/dist/pipeline/src/context/getEnvConfig.js +29 -28
- package/dist/pipeline/src/context/getEnvType.d.ts +2 -2
- package/dist/pipeline/src/context/getEnvType.js +10 -9
- package/dist/pipeline/src/context/getEnvironment.d.ts +1 -1
- package/dist/pipeline/src/context/getEnvironment.js +20 -16
- package/dist/pipeline/src/context/getEnvironmentContext.d.ts +6 -1
- package/dist/pipeline/src/context/getEnvironmentContext.js +35 -28
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +11 -11
- package/dist/pipeline/src/context/getEnvironmentVariables.js +102 -95
- package/dist/pipeline/src/context/getLabels.d.ts +7 -7
- package/dist/pipeline/src/context/getLabels.js +26 -25
- package/dist/pipeline/src/context/getReviewSlug.d.ts +1 -1
- package/dist/pipeline/src/context/getReviewSlug.js +12 -10
- package/dist/pipeline/src/context/index.d.ts +1 -1
- package/dist/pipeline/src/context/index.js +23 -16
- package/dist/pipeline/src/context/transformJobOnlyVars.d.ts +3 -3
- package/dist/pipeline/src/context/transformJobOnlyVars.js +21 -21
- package/dist/pipeline/src/context/utils/envVars.d.ts +3 -3
- package/dist/pipeline/src/context/utils/envVars.js +12 -12
- package/dist/pipeline/src/defaults/index.d.ts +1 -1
- package/dist/pipeline/src/defaults/index.js +6 -4
- package/dist/pipeline/src/deploy/base/deploy.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/deploy.js +75 -100
- package/dist/pipeline/src/deploy/base/index.d.ts +4 -4
- package/dist/pipeline/src/deploy/base/index.js +6 -10
- package/dist/pipeline/src/deploy/base/rollback.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/rollback.js +30 -26
- package/dist/pipeline/src/deploy/base/stop.d.ts +1 -1
- package/dist/pipeline/src/deploy/base/stop.js +30 -25
- package/dist/pipeline/src/deploy/base/variables.d.ts +4 -4
- package/dist/pipeline/src/deploy/base/variables.js +8 -6
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js +55 -67
- package/dist/pipeline/src/deploy/cloudRun/cleanup.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/cleanup.js +16 -17
- package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js +44 -41
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +4 -4
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js +58 -63
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js +63 -73
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunWorkerPools.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunWorkerPools.js +38 -38
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.d.ts +7 -7
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js +33 -38
- package/dist/pipeline/src/deploy/cloudRun/createJobs/constants.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/constants.js +5 -3
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/onDeploy.js +57 -67
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.js +115 -118
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +10 -32
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js +9 -23
- package/dist/pipeline/src/deploy/cloudRun/createJobs/healthCheck.d.ts +3 -3
- package/dist/pipeline/src/deploy/cloudRun/createJobs/healthCheck.js +36 -39
- package/dist/pipeline/src/deploy/cloudRun/createJobs/index.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js +36 -37
- package/dist/pipeline/src/deploy/cloudRun/createJobs/volumes.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/volumes.js +19 -13
- package/dist/pipeline/src/deploy/cloudRun/index.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/index.js +72 -76
- package/dist/pipeline/src/deploy/cloudRun/utils/cloudRunExecutionUrl.d.ts +9 -5
- package/dist/pipeline/src/deploy/cloudRun/utils/cloudRunExecutionUrl.js +13 -7
- package/dist/pipeline/src/deploy/cloudRun/utils/createArgsString.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/createArgsString.js +13 -17
- package/dist/pipeline/src/deploy/cloudRun/utils/database.d.ts +5 -5
- package/dist/pipeline/src/deploy/cloudRun/utils/database.js +46 -79
- package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +6 -6
- package/dist/pipeline/src/deploy/cloudRun/utils/getJobOrServiceArgs.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/getJobOrServiceArgs.js +7 -9
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.js +6 -4
- package/dist/pipeline/src/deploy/cloudRun/utils/jobName.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/jobName.js +5 -3
- package/dist/pipeline/src/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.js +6 -4
- package/dist/pipeline/src/deploy/cloudSql/utils.d.ts +1 -1
- package/dist/pipeline/src/deploy/cloudSql/utils.js +7 -9
- package/dist/pipeline/src/deploy/custom/deployJob.d.ts +1 -1
- package/dist/pipeline/src/deploy/custom/deployJob.js +30 -34
- package/dist/pipeline/src/deploy/custom/index.d.ts +1 -1
- package/dist/pipeline/src/deploy/custom/index.js +9 -7
- package/dist/pipeline/src/deploy/dockerTag/deployJob.d.ts +1 -1
- package/dist/pipeline/src/deploy/dockerTag/deployJob.js +18 -22
- package/dist/pipeline/src/deploy/dockerTag/index.d.ts +1 -1
- package/dist/pipeline/src/deploy/dockerTag/index.js +9 -7
- package/dist/pipeline/src/deploy/index.d.ts +6 -8
- package/dist/pipeline/src/deploy/index.js +27 -20
- package/dist/pipeline/src/deploy/kubernetes/additionalSecretKeys.d.ts +5 -3
- package/dist/pipeline/src/deploy/kubernetes/additionalSecretKeys.js +25 -19
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.d.ts +7 -7
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js +36 -35
- package/dist/pipeline/src/deploy/kubernetes/deployJob.d.ts +1 -1
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js +46 -61
- package/dist/pipeline/src/deploy/kubernetes/index.d.ts +1 -1
- package/dist/pipeline/src/deploy/kubernetes/index.js +54 -45
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.d.ts +3 -3
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js +35 -34
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +84 -84
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +70 -63
- package/dist/pipeline/src/deploy/kubernetes/mongodb.d.ts +28 -28
- package/dist/pipeline/src/deploy/kubernetes/mongodb.js +88 -93
- package/dist/pipeline/src/deploy/types/base.d.ts +27 -27
- package/dist/pipeline/src/deploy/types/base.js +4 -2
- package/dist/pipeline/src/deploy/types/custom.d.ts +25 -25
- package/dist/pipeline/src/deploy/types/custom.js +4 -2
- package/dist/pipeline/src/deploy/types/dockerTag.d.ts +10 -10
- package/dist/pipeline/src/deploy/types/dockerTag.js +4 -2
- package/dist/pipeline/src/deploy/types/executeBase.d.ts +15 -15
- package/dist/pipeline/src/deploy/types/executeBase.js +4 -2
- package/dist/pipeline/src/deploy/types/googleCloudRun.d.ts +435 -435
- package/dist/pipeline/src/deploy/types/googleCloudRun.js +16 -14
- package/dist/pipeline/src/deploy/types/index.d.ts +6 -6
- package/dist/pipeline/src/deploy/types/index.js +27 -21
- package/dist/pipeline/src/deploy/types/kubernetes.d.ts +255 -255
- package/dist/pipeline/src/deploy/types/kubernetes.js +4 -2
- package/dist/pipeline/src/deploy/utils.d.ts +1 -1
- package/dist/pipeline/src/deploy/utils.js +23 -21
- package/dist/pipeline/src/globalScriptFunctions/index.d.ts +6 -6
- package/dist/pipeline/src/globalScriptFunctions/index.js +21 -19
- package/dist/pipeline/src/index.d.ts +1 -1
- package/dist/pipeline/src/index.js +23 -16
- package/dist/pipeline/src/pipeline/agent/createAgentContext.d.ts +19 -19
- package/dist/pipeline/src/pipeline/agent/createAgentContext.js +41 -37
- package/dist/pipeline/src/pipeline/agent/createAgentEventJob.d.ts +1 -1
- package/dist/pipeline/src/pipeline/agent/createAgentEventJob.js +30 -31
- package/dist/pipeline/src/pipeline/agent/createAgentReviewJob.d.ts +1 -1
- package/dist/pipeline/src/pipeline/agent/createAgentReviewJob.js +36 -44
- package/dist/pipeline/src/pipeline/agent/createJobsForAgentContext.d.ts +1 -1
- package/dist/pipeline/src/pipeline/agent/createJobsForAgentContext.js +7 -5
- package/dist/pipeline/src/pipeline/agent/prompts.d.ts +2 -2
- package/dist/pipeline/src/pipeline/agent/prompts.js +32 -14
- package/dist/pipeline/src/pipeline/agent/shared.d.ts +5 -3
- package/dist/pipeline/src/pipeline/agent/shared.js +26 -24
- package/dist/pipeline/src/pipeline/agent/utils.d.ts +1 -1
- package/dist/pipeline/src/pipeline/agent/utils.js +11 -9
- package/dist/pipeline/src/pipeline/createAllJobs.d.ts +17 -13
- package/dist/pipeline/src/pipeline/createAllJobs.js +56 -44
- package/dist/pipeline/src/pipeline/createJobsForComponent.d.ts +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.js +28 -27
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.d.ts +1 -1
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.js +8 -6
- package/dist/pipeline/src/pipeline/createMainPipeline.d.ts +1 -1
- package/dist/pipeline/src/pipeline/createMainPipeline.js +85 -79
- package/dist/pipeline/src/pipeline/generatePipelineFiles.d.ts +1 -1
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js +78 -58
- package/dist/pipeline/src/pipeline/getPipelineStages.d.ts +1 -1
- package/dist/pipeline/src/pipeline/getPipelineStages.js +8 -10
- package/dist/pipeline/src/pipeline/gitlab/cache.d.ts +5 -5
- package/dist/pipeline/src/pipeline/gitlab/cache.js +26 -24
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.d.ts +4 -4
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js +228 -239
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.d.ts +7 -2
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.js +64 -59
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.d.ts +34 -34
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js +37 -47
- package/dist/pipeline/src/pipeline/gitlab/sortGitLabJobDefProps.d.ts +1 -1
- package/dist/pipeline/src/pipeline/gitlab/sortGitLabJobDefProps.js +10 -40
- package/dist/pipeline/src/pipeline/index.d.ts +1 -1
- package/dist/pipeline/src/pipeline/index.js +23 -16
- package/dist/pipeline/src/pipeline/packageManager.d.ts +1 -1
- package/dist/pipeline/src/pipeline/packageManager.js +47 -59
- package/dist/pipeline/src/rules/index.d.ts +1 -1
- package/dist/pipeline/src/rules/index.js +15 -13
- package/dist/pipeline/src/runner/index.d.ts +1 -1
- package/dist/pipeline/src/runner/index.js +6 -4
- package/dist/pipeline/src/types/agent.d.ts +15 -15
- package/dist/pipeline/src/types/agent.js +4 -2
- package/dist/pipeline/src/types/config.d.ts +152 -154
- package/dist/pipeline/src/types/config.js +24 -28
- package/dist/pipeline/src/types/context.d.ts +104 -104
- package/dist/pipeline/src/types/context.js +9 -7
- package/dist/pipeline/src/types/environmentContext.d.ts +25 -25
- package/dist/pipeline/src/types/environmentContext.js +4 -2
- package/dist/pipeline/src/types/gitlab-ci-yml.d.ts +497 -497
- package/dist/pipeline/src/types/gitlab-ci-yml.js +4 -2
- package/dist/pipeline/src/types/gitlab-types.d.ts +15 -15
- package/dist/pipeline/src/types/gitlab-types.js +4 -2
- package/dist/pipeline/src/types/hooks.d.ts +26 -26
- package/dist/pipeline/src/types/hooks.js +4 -2
- package/dist/pipeline/src/types/index.d.ts +1 -1
- package/dist/pipeline/src/types/index.js +23 -16
- package/dist/pipeline/src/types/jobDefinition.d.ts +3 -3
- package/dist/pipeline/src/types/jobDefinition.js +4 -2
- package/dist/pipeline/src/types/jobs.d.ts +93 -93
- package/dist/pipeline/src/types/jobs.js +5 -12
- package/dist/pipeline/src/types/pipeline.d.ts +1 -1
- package/dist/pipeline/src/types/pipeline.js +4 -2
- package/dist/pipeline/src/types/release.d.ts +6 -6
- package/dist/pipeline/src/types/release.js +4 -2
- package/dist/pipeline/src/types/utils.d.ts +1 -3
- package/dist/pipeline/src/types/utils.js +4 -2
- package/dist/pipeline/src/utils/gitlab.d.ts +2 -2
- package/dist/pipeline/src/utils/gitlab.js +12 -15
- package/dist/pipeline/src/utils/index.d.ts +1 -1
- package/dist/pipeline/src/utils/index.js +12 -9
- package/dist/pipeline/src/utils/jsonParse.d.ts +1 -1
- package/dist/pipeline/src/utils/jsonParse.js +11 -10
- package/dist/pipeline/src/utils/measureTime.d.ts +4 -4
- package/dist/pipeline/src/utils/measureTime.js +39 -34
- package/dist/pipeline/src/utils/removeUndefined.d.ts +1 -1
- package/dist/pipeline/src/utils/removeUndefined.js +6 -4
- package/dist/pipeline/src/utils/writeFiles.d.ts +10 -10
- package/dist/pipeline/src/utils/writeFiles.js +53 -59
- package/dist/pipeline/src/variables/VariableValue.d.ts +1 -1
- package/dist/pipeline/src/variables/VariableValue.js +4 -2
- package/dist/pipeline/src/variables/VariableValueContainingReferences.d.ts +12 -12
- package/dist/pipeline/src/variables/VariableValueContainingReferences.js +45 -51
- package/dist/pipeline/src/variables/resolveAllReferences.d.ts +1 -1
- package/dist/pipeline/src/variables/resolveAllReferences.js +17 -18
- package/dist/pipeline/src/variables/resolveAllReferencesOnce.d.ts +2 -2
- package/dist/pipeline/src/variables/resolveAllReferencesOnce.js +14 -17
- package/dist/pipeline/src/variables/resolveReferencesOnce.d.ts +3 -3
- package/dist/pipeline/src/variables/resolveReferencesOnce.js +17 -16
- package/package.json +7 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function runCatCi(): Promise<void>;
|
|
1
|
+
export declare function runCatCi(): Promise<void>;
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
"default": mod
|
|
6
|
+
};
|
|
4
7
|
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
6
11
|
exports.runCatCi = void 0;
|
|
7
12
|
const vorpal_1 = __importDefault(require("vorpal"));
|
|
8
13
|
const packageInfos_1 = __importDefault(require("../../packageInfos"));
|
|
9
14
|
const commands_1 = __importDefault(require("./commands/security/commands"));
|
|
10
15
|
function reconstructArgs(args) {
|
|
11
|
-
|
|
16
|
+
return [args[0], ...args.slice(1).map(arg => `"${arg}"`)].join(" ");
|
|
12
17
|
}
|
|
13
18
|
async function runCatCi() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
19
|
+
const vorpal = new vorpal_1.default();
|
|
20
|
+
process.exitCode = 0;
|
|
21
|
+
vorpal.delimiter("catci $").history("catci").version(packageInfos_1.default.version);
|
|
22
|
+
(0, commands_1.default)(vorpal);
|
|
23
|
+
const isInteractive = process.argv.length <= 2;
|
|
24
|
+
if (isInteractive) {
|
|
25
|
+
vorpal.log(`Catladder CI Tools 😻🔨 version ${packageInfos_1.default.version}`).show();
|
|
26
|
+
} else {
|
|
27
|
+
process.exitCode = 1;
|
|
28
|
+
const args = reconstructArgs(process.argv.slice(2));
|
|
29
|
+
await vorpal.exec(args);
|
|
30
|
+
process.exit();
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
|
-
exports.runCatCi = runCatCi;
|
|
30
|
-
//# sourceMappingURL=catci.js.map
|
|
33
|
+
exports.runCatCi = runCatCi;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare function makeTemplate(): string;
|
|
2
2
|
export type SecurityEvaluation = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
topics: {
|
|
4
|
+
description: string;
|
|
5
|
+
responsibles: string[];
|
|
6
|
+
note: string;
|
|
7
|
+
isUnknown: boolean;
|
|
8
|
+
isAnswered: boolean;
|
|
9
|
+
isSecured: boolean;
|
|
10
|
+
}[];
|
|
11
|
+
score: {
|
|
12
|
+
rating: number;
|
|
13
|
+
totalTopics: number;
|
|
14
|
+
answeredTopics: number;
|
|
15
|
+
securedTopics: number;
|
|
16
|
+
unknownTopics: number;
|
|
17
|
+
};
|
|
18
18
|
};
|
|
19
|
-
export declare function evaluateDocument(document: string): SecurityEvaluation;
|
|
19
|
+
export declare function evaluateDocument(document: string): SecurityEvaluation;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
"default": mod
|
|
6
|
+
};
|
|
4
7
|
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
6
11
|
exports.evaluateDocument = exports.makeTemplate = void 0;
|
|
7
12
|
const topics_json_1 = __importDefault(require("./topics.json"));
|
|
8
13
|
const allTopics = topics_json_1.default;
|
|
@@ -10,37 +15,26 @@ const checkYes = "✅";
|
|
|
10
15
|
const checkNo = "❌";
|
|
11
16
|
const checkPlaceholder = `${checkYes}/${checkNo}`;
|
|
12
17
|
const responsiblePlaceholder = "@...";
|
|
13
|
-
const rows = [
|
|
14
|
-
["Responsible", checkPlaceholder, "Description", "Note", "More Information"],
|
|
15
|
-
].concat(allTopics.map((t) => [
|
|
16
|
-
Array(t.responsibles).fill(responsiblePlaceholder).join(", "),
|
|
17
|
-
checkPlaceholder,
|
|
18
|
-
t.description,
|
|
19
|
-
"",
|
|
20
|
-
t.more,
|
|
21
|
-
]));
|
|
18
|
+
const rows = [["Responsible", checkPlaceholder, "Description", "Note", "More Information"]].concat(allTopics.map(t => [Array(t.responsibles).fill(responsiblePlaceholder).join(", "), checkPlaceholder, t.description, "", t.more]));
|
|
22
19
|
function makeTable(rows) {
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
const colWidths = calculateColumnWidths(rows);
|
|
21
|
+
return `
|
|
25
22
|
${makeRow(rows[0], colWidths, " ")}
|
|
26
23
|
${makeRow(rows[0].map(() => ""), colWidths, "-")}
|
|
27
|
-
${rows
|
|
28
|
-
.slice(1)
|
|
29
|
-
.map((row) => makeRow(row, colWidths, " "))
|
|
30
|
-
.join("\n")}
|
|
24
|
+
${rows.slice(1).map(row => makeRow(row, colWidths, " ")).join("\n")}
|
|
31
25
|
`;
|
|
32
26
|
}
|
|
33
27
|
function calculateColumnWidths(rows) {
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
const columnCount = rows[0].length;
|
|
29
|
+
return Array.from({
|
|
30
|
+
length: columnCount
|
|
31
|
+
}, (_, i) => i).map(columnIndex => Math.max(...rows.map(row => row[columnIndex].length)));
|
|
36
32
|
}
|
|
37
33
|
function makeRow(row, colWidths, fillString) {
|
|
38
|
-
|
|
39
|
-
.map((cell, i) => cell.padEnd(colWidths[i], fillString))
|
|
40
|
-
.join(" | ")} |`;
|
|
34
|
+
return `| ${row.map((cell, i) => cell.padEnd(colWidths[i], fillString)).join(" | ")} |`;
|
|
41
35
|
}
|
|
42
36
|
function makeTemplate() {
|
|
43
|
-
|
|
37
|
+
return `
|
|
44
38
|
# Security Audit Report
|
|
45
39
|
|
|
46
40
|
A security audit report document is a comprehensive assessment of an application's security posture, containing security topics that auditors can mark to indicate the state of various security aspects.
|
|
@@ -63,47 +57,42 @@ ${makeTable(rows)}
|
|
|
63
57
|
}
|
|
64
58
|
exports.makeTemplate = makeTemplate;
|
|
65
59
|
function evaluateDocument(document) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const isAnswered = !isUnknown &&
|
|
79
|
-
!answer.includes(checkPlaceholder) &&
|
|
80
|
-
!responsibles.some((responsible) => responsible.includes(responsiblePlaceholder));
|
|
81
|
-
const isSecured = !isUnknown && isAnswered && answer.includes(checkYes);
|
|
82
|
-
return {
|
|
83
|
-
responsibles,
|
|
84
|
-
answer,
|
|
85
|
-
description,
|
|
86
|
-
note,
|
|
87
|
-
isUnknown,
|
|
88
|
-
isAnswered,
|
|
89
|
-
isSecured,
|
|
90
|
-
};
|
|
91
|
-
});
|
|
92
|
-
const totalTopics = allTopics.length;
|
|
93
|
-
const answeredTopics = topics.filter((t) => t.isAnswered).length;
|
|
94
|
-
const securedTopics = topics.filter((t) => t.isSecured).length;
|
|
95
|
-
const unknownTopics = topics.filter((t) => t.isUnknown).length;
|
|
96
|
-
const rating = Math.round((securedTopics / totalTopics) * 100);
|
|
60
|
+
var _a, _b;
|
|
61
|
+
const rawRows = (_b = (_a = document.match(/^\s*\|.*?\|\s*$/gm)) === null || _a === void 0 ? void 0 : _a.map(row => row.trim())) !== null && _b !== void 0 ? _b : [];
|
|
62
|
+
const matchedRows = rawRows.map(row => row.split("|").map(col => col.trim())).slice(2);
|
|
63
|
+
const knownTopics = new Set(allTopics.map(t => t.description));
|
|
64
|
+
const topics = matchedRows.map(col => {
|
|
65
|
+
const responsibles = col[1].split(", ");
|
|
66
|
+
const answer = col[2];
|
|
67
|
+
const description = col[3];
|
|
68
|
+
const note = col[4];
|
|
69
|
+
const isUnknown = !knownTopics.has(description);
|
|
70
|
+
const isAnswered = !isUnknown && !answer.includes(checkPlaceholder) && !responsibles.some(responsible => responsible.includes(responsiblePlaceholder));
|
|
71
|
+
const isSecured = !isUnknown && isAnswered && answer.includes(checkYes);
|
|
97
72
|
return {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
},
|
|
73
|
+
responsibles,
|
|
74
|
+
answer,
|
|
75
|
+
description,
|
|
76
|
+
note,
|
|
77
|
+
isUnknown,
|
|
78
|
+
isAnswered,
|
|
79
|
+
isSecured
|
|
106
80
|
};
|
|
81
|
+
});
|
|
82
|
+
const totalTopics = allTopics.length;
|
|
83
|
+
const answeredTopics = topics.filter(t => t.isAnswered).length;
|
|
84
|
+
const securedTopics = topics.filter(t => t.isSecured).length;
|
|
85
|
+
const unknownTopics = topics.filter(t => t.isUnknown).length;
|
|
86
|
+
const rating = Math.round(securedTopics / totalTopics * 100);
|
|
87
|
+
return {
|
|
88
|
+
topics,
|
|
89
|
+
score: {
|
|
90
|
+
rating,
|
|
91
|
+
totalTopics,
|
|
92
|
+
answeredTopics,
|
|
93
|
+
securedTopics,
|
|
94
|
+
unknownTopics
|
|
95
|
+
}
|
|
96
|
+
};
|
|
107
97
|
}
|
|
108
|
-
exports.evaluateDocument = evaluateDocument;
|
|
109
|
-
//# sourceMappingURL=auditDocument.js.map
|
|
98
|
+
exports.evaluateDocument = evaluateDocument;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type Vorpal from "vorpal";
|
|
2
|
-
export default function (vorpal: Vorpal): void;
|
|
2
|
+
export default function (vorpal: Vorpal): void;
|
|
@@ -1,110 +1,118 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
const evaluateSecurityAudit_1 = require("./evaluateSecurityAudit");
|
|
4
7
|
const rest_1 = require("@gitbeaker/rest");
|
|
5
8
|
const createSecurityAuditMergeRequest_1 = require("./createSecurityAuditMergeRequest");
|
|
6
9
|
const ts_results_es_1 = require("ts-results-es");
|
|
7
10
|
const GITLAB_HOST = "https://git.panter.ch";
|
|
8
11
|
function default_1(vorpal) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
commandCiJob(vorpal);
|
|
13
|
+
commandEvaluate(vorpal);
|
|
14
|
+
commandCreate(vorpal);
|
|
12
15
|
}
|
|
13
16
|
exports.default = default_1;
|
|
14
17
|
function resultAsExitCode(func) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
return async args => {
|
|
19
|
+
const result = await func(args);
|
|
20
|
+
process.exitCode = result.isErr() ? 1 : 0;
|
|
21
|
+
};
|
|
19
22
|
}
|
|
20
23
|
async function commandCiJob(vorpal) {
|
|
21
|
-
|
|
22
|
-
.command("security-audit-ci-job <path> <token> <mainBranch> <projectId> <userId>", `Evaluates security audit document. If the document can't be evaluated or does not exist, creates a new MR with security audit document template.
|
|
24
|
+
vorpal.command("security-audit-ci-job <path> <token> <mainBranch> <projectId> <userId>", `Evaluates security audit document. If the document can't be evaluated or does not exist, creates a new MR with security audit document template.
|
|
23
25
|
|
|
24
26
|
<path> root path of a project with security audit document (${createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME})
|
|
25
27
|
<token> gitlab token with 'api' scopes and permissions to create a new branch
|
|
26
28
|
<main-branch> main branch name
|
|
27
29
|
<project-id> project id to create security audit for
|
|
28
30
|
<user-id> gitlab user id that will be assignee of the audit
|
|
29
|
-
`)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
31
|
+
`).action(resultAsExitCode(async args => {
|
|
32
|
+
const evaluation = await (0, evaluateSecurityAudit_1.evaluateSecurityAudit)({
|
|
33
|
+
path: args.path
|
|
34
|
+
});
|
|
35
|
+
if (evaluation.isErr()) {
|
|
36
|
+
console.log("could not evaluate security audit document");
|
|
37
|
+
console.log("creating new merge request with security audit template...");
|
|
38
|
+
const {
|
|
39
|
+
token,
|
|
40
|
+
mainBranch,
|
|
41
|
+
projectId,
|
|
42
|
+
userId
|
|
43
|
+
} = args;
|
|
44
|
+
const api = new rest_1.Gitlab({
|
|
45
|
+
host: GITLAB_HOST,
|
|
46
|
+
token
|
|
47
|
+
});
|
|
48
|
+
const mr = await (0, createSecurityAuditMergeRequest_1.createSecurityAuditMergeRequest)({
|
|
49
|
+
api,
|
|
50
|
+
mainBranch,
|
|
51
|
+
projectId,
|
|
52
|
+
userId: parseInt(userId)
|
|
53
|
+
});
|
|
54
|
+
if (mr.isErr()) {
|
|
55
|
+
console.error(`could not create merge request with security audit template: ${mr.error}`);
|
|
56
|
+
return mr;
|
|
57
|
+
}
|
|
58
|
+
console.log("security audit merge request created successfully");
|
|
59
|
+
console.log(`please finish the MR by updating SECURITY.md document: ${mr.value.web_url}`);
|
|
60
|
+
return (0, ts_results_es_1.Err)("merge request created");
|
|
61
|
+
}
|
|
62
|
+
if (evaluation.value.score.answeredTopics === 0) {
|
|
63
|
+
console.error("audit document has no answered topics");
|
|
64
|
+
console.error(`please answer security topics in ${createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME} by adding responsible people and check/cross in the table`);
|
|
65
|
+
return (0, ts_results_es_1.Err)("audit document has no answered topics");
|
|
66
|
+
}
|
|
67
|
+
console.log((0, evaluateSecurityAudit_1.makeSecurityAuditOverview)(evaluation.value));
|
|
68
|
+
return (0, ts_results_es_1.Ok)({});
|
|
69
|
+
}));
|
|
62
70
|
}
|
|
63
71
|
async function commandEvaluate(vorpal) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}));
|
|
72
|
+
vorpal.command("security-audit-evaluate <path>", "Evaluates security audit document in given <path>").action(resultAsExitCode(async args => {
|
|
73
|
+
console.log("evaluating security audit document...");
|
|
74
|
+
const result = await (0, evaluateSecurityAudit_1.evaluateSecurityAudit)({
|
|
75
|
+
path: args.path
|
|
76
|
+
});
|
|
77
|
+
if (result.isErr()) {
|
|
78
|
+
console.error(result.error);
|
|
79
|
+
console.error(`please make sure the security audit document ${createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME} is in the repository`);
|
|
80
|
+
} else {
|
|
81
|
+
console.log((0, evaluateSecurityAudit_1.makeSecurityAuditOverview)(result.value));
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}));
|
|
78
85
|
}
|
|
79
86
|
async function commandCreate(vorpal) {
|
|
80
|
-
|
|
81
|
-
.command("security-audit-create <token> <mainBranch> <projectId> <userId>", `Creates a MR in given project with the latest security audit template document
|
|
87
|
+
vorpal.command("security-audit-create <token> <mainBranch> <projectId> <userId>", `Creates a MR in given project with the latest security audit template document
|
|
82
88
|
|
|
83
89
|
<token> gitlab token with 'api' scopes and permissions to create a new branch
|
|
84
90
|
<main-branch> main branch name
|
|
85
91
|
<project-id> project id to create security audit for
|
|
86
92
|
<user-id> gitlab user id that will be assignee of the audit
|
|
87
|
-
`)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
93
|
+
`).action(resultAsExitCode(async args => {
|
|
94
|
+
const {
|
|
95
|
+
token,
|
|
96
|
+
mainBranch,
|
|
97
|
+
projectId,
|
|
98
|
+
userId
|
|
99
|
+
} = args;
|
|
100
|
+
const api = new rest_1.Gitlab({
|
|
101
|
+
host: GITLAB_HOST,
|
|
102
|
+
token
|
|
103
|
+
});
|
|
104
|
+
const result = await (0, createSecurityAuditMergeRequest_1.createSecurityAuditMergeRequest)({
|
|
105
|
+
api,
|
|
106
|
+
mainBranch,
|
|
107
|
+
projectId,
|
|
108
|
+
userId: parseInt(userId)
|
|
109
|
+
});
|
|
110
|
+
if (result.isErr()) {
|
|
111
|
+
console.error(`could not create security audit merge request: ${result.error}`);
|
|
112
|
+
} else {
|
|
113
|
+
console.log("security audit merge request created successfully");
|
|
114
|
+
console.log(`please finish the MR by updating SECURITY.md document: ${result.value.web_url}`);
|
|
115
|
+
}
|
|
116
|
+
return result;
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { Gitlab } from "@gitbeaker/core";
|
|
2
2
|
import { Err } from "ts-results-es";
|
|
3
3
|
export declare const SECURITY_AUDIT_FILE_NAME: "SECURITY.md";
|
|
4
|
-
export declare function createSecurityAuditMergeRequest({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
4
|
+
export declare function createSecurityAuditMergeRequest({
|
|
5
|
+
projectId,
|
|
6
|
+
mainBranch,
|
|
7
|
+
userId,
|
|
8
|
+
api
|
|
9
|
+
}: {
|
|
10
|
+
projectId: string;
|
|
11
|
+
mainBranch: string;
|
|
12
|
+
userId: number;
|
|
13
|
+
api: Gitlab;
|
|
14
|
+
}): Promise<Err<string> | import("ts-results-es").Ok<import("@gitbeaker/core").ExpandedMergeRequestSchema>>;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.createSecurityAuditMergeRequest = exports.SECURITY_AUDIT_FILE_NAME = void 0;
|
|
4
7
|
const ts_results_es_1 = require("ts-results-es");
|
|
5
8
|
const auditDocument_1 = require("./auditDocument");
|
|
6
9
|
function makeDatedBranchName(branchName) {
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
const date = new Date().toISOString().slice(0, -5).replaceAll(/[:.T]/g, "-");
|
|
11
|
+
return `${branchName}-${date}`;
|
|
9
12
|
}
|
|
10
13
|
const MR_TITLE = "Draft: chore(security): add security audit document";
|
|
11
14
|
exports.SECURITY_AUDIT_FILE_NAME = "SECURITY.md";
|
|
12
|
-
async function createSecurityAuditMergeRequest({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}))).mapErr(() => "could not create merge request");
|
|
49
|
-
return mr;
|
|
15
|
+
async function createSecurityAuditMergeRequest({
|
|
16
|
+
projectId,
|
|
17
|
+
mainBranch,
|
|
18
|
+
userId,
|
|
19
|
+
api
|
|
20
|
+
}) {
|
|
21
|
+
const mrs = (await ts_results_es_1.Result.wrapAsync(() => api.MergeRequests.all({
|
|
22
|
+
state: "opened",
|
|
23
|
+
wip: "yes",
|
|
24
|
+
labels: "security-audit"
|
|
25
|
+
}))).mapErr(() => `could not search for existing merge requests`);
|
|
26
|
+
if (mrs.isErr()) return mrs;
|
|
27
|
+
const existingMr = mrs.value[0];
|
|
28
|
+
if (existingMr) return (0, ts_results_es_1.Err)(`open merge request with security audit already exists: ${existingMr.web_url}`);
|
|
29
|
+
const auditTemplate = ts_results_es_1.Result.wrap(() => (0, auditDocument_1.makeTemplate)()).mapErr(() => "could not make security audit template document");
|
|
30
|
+
if (auditTemplate.isErr()) return auditTemplate;
|
|
31
|
+
const branch = (await ts_results_es_1.Result.wrapAsync(() => api.Branches.create(projectId, makeDatedBranchName("chore/security-audit"), mainBranch))).mapErr(e => {
|
|
32
|
+
console.log(e);
|
|
33
|
+
return "could not create branch";
|
|
34
|
+
});
|
|
35
|
+
if (branch.isErr()) return branch;
|
|
36
|
+
const commit = (await ts_results_es_1.Result.wrapAsync(() => api.Commits.create(projectId, branch.value.name, "chore(security): add empty security audit document template", [{
|
|
37
|
+
action: "create",
|
|
38
|
+
filePath: exports.SECURITY_AUDIT_FILE_NAME,
|
|
39
|
+
content: auditTemplate.value,
|
|
40
|
+
encoding: "text"
|
|
41
|
+
}]))).mapErr(() => "could not create commit");
|
|
42
|
+
if (commit.isErr()) return commit;
|
|
43
|
+
const mr = (await ts_results_es_1.Result.wrapAsync(() => api.MergeRequests.create(projectId, branch.value.name, mainBranch, MR_TITLE, {
|
|
44
|
+
description: `Please follow and update security audit document in \`${exports.SECURITY_AUDIT_FILE_NAME}\`.`,
|
|
45
|
+
assigneeId: userId,
|
|
46
|
+
squash: true,
|
|
47
|
+
labels: "security-audit",
|
|
48
|
+
removeSourceBranch: true
|
|
49
|
+
}))).mapErr(() => "could not create merge request");
|
|
50
|
+
return mr;
|
|
50
51
|
}
|
|
51
|
-
exports.createSecurityAuditMergeRequest = createSecurityAuditMergeRequest;
|
|
52
|
-
//# sourceMappingURL=createSecurityAuditMergeRequest.js.map
|
|
52
|
+
exports.createSecurityAuditMergeRequest = createSecurityAuditMergeRequest;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { SecurityEvaluation } from "./auditDocument";
|
|
2
|
-
export declare function evaluateSecurityAudit({
|
|
3
|
-
|
|
2
|
+
export declare function evaluateSecurityAudit({
|
|
3
|
+
path
|
|
4
|
+
}: {
|
|
5
|
+
path: string;
|
|
4
6
|
}): Promise<import("ts-results-es").Err<string> | import("ts-results-es").Ok<SecurityEvaluation>>;
|
|
5
|
-
export declare function makeSecurityAuditOverview(evaluation: SecurityEvaluation): string;
|
|
7
|
+
export declare function makeSecurityAuditOverview(evaluation: SecurityEvaluation): string;
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.makeSecurityAuditOverview = exports.evaluateSecurityAudit = void 0;
|
|
4
7
|
const ts_results_es_1 = require("ts-results-es");
|
|
5
8
|
const path_1 = require("path");
|
|
6
9
|
const promises_1 = require("fs/promises");
|
|
7
10
|
const createSecurityAuditMergeRequest_1 = require("./createSecurityAuditMergeRequest");
|
|
8
11
|
const auditDocument_1 = require("./auditDocument");
|
|
9
|
-
async function evaluateSecurityAudit({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
async function evaluateSecurityAudit({
|
|
13
|
+
path
|
|
14
|
+
}) {
|
|
15
|
+
return (await ts_results_es_1.Result.wrapAsync(async () => {
|
|
16
|
+
const filePath = (0, path_1.join)(path, createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME);
|
|
17
|
+
const docData = await (0, promises_1.readFile)(filePath);
|
|
18
|
+
const doc = docData.toString("utf-8");
|
|
19
|
+
return (0, auditDocument_1.evaluateDocument)(doc);
|
|
20
|
+
})).mapErr(e => `could not evaluate ${createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME}: ${e}`);
|
|
16
21
|
}
|
|
17
22
|
exports.evaluateSecurityAudit = evaluateSecurityAudit;
|
|
18
23
|
function makeSecurityAuditOverview(evaluation) {
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
const ratingToEmo = r => r < 33 ? "🟥" : r < 66 ? "🟨" : "🟩";
|
|
25
|
+
return `Project security posture overview:
|
|
21
26
|
🧐 Total topics: ${evaluation.score.totalTopics}
|
|
22
27
|
🔒 Secured topics: ${evaluation.score.securedTopics}
|
|
23
28
|
📢 Answered topics: ${evaluation.score.answeredTopics}
|
|
24
29
|
❔ Unknown topics: ${evaluation.score.unknownTopics}
|
|
25
30
|
📊 Rating: ${ratingToEmo(evaluation.score.rating)} ${evaluation.score.rating}/100`;
|
|
26
31
|
}
|
|
27
|
-
exports.makeSecurityAuditOverview = makeSecurityAuditOverview;
|
|
28
|
-
//# sourceMappingURL=evaluateSecurityAudit.js.map
|
|
32
|
+
exports.makeSecurityAuditOverview = makeSecurityAuditOverview;
|