@catladder/cli 0.0.0-main-6a946974 → 0.0.0-main-7c9385f9
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/dist/bundles/catci/index.js +253 -514
- package/dist/bundles/catenv/index.js +2984 -6491
- package/dist/bundles/cli/index.js +5263 -13083
- package/dist/cli/src/apps/catci/catci.js +19 -91
- package/dist/cli/src/apps/catci/catci.js.map +1 -1
- package/dist/cli/src/apps/catci/commands/security/auditDocument.js +73 -79
- package/dist/cli/src/apps/catci/commands/security/auditDocument.js.map +1 -1
- package/dist/cli/src/apps/catci/commands/security/commands.js +94 -169
- package/dist/cli/src/apps/catci/commands/security/commands.js.map +1 -1
- package/dist/cli/src/apps/catci/commands/security/createSecurityAuditMergeRequest.js +42 -102
- package/dist/cli/src/apps/catci/commands/security/createSecurityAuditMergeRequest.js.map +1 -1
- package/dist/cli/src/apps/catci/commands/security/evaluateSecurityAudit.js +19 -67
- package/dist/cli/src/apps/catci/commands/security/evaluateSecurityAudit.js.map +1 -1
- package/dist/cli/src/apps/catenv/catenv.js +18 -64
- package/dist/cli/src/apps/catenv/catenv.js.map +1 -1
- package/dist/cli/src/apps/catenv/printVariables.js +36 -123
- package/dist/cli/src/apps/catenv/printVariables.js.map +1 -1
- package/dist/cli/src/apps/catenv/utils.js +26 -112
- package/dist/cli/src/apps/catenv/utils.js.map +1 -1
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js +28 -132
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js.map +1 -1
- package/dist/cli/src/apps/catenv/writeEnvDTs.js +49 -150
- package/dist/cli/src/apps/catenv/writeEnvDTs.js.map +1 -1
- package/dist/cli/src/apps/cli/cli.js +31 -76
- package/dist/cli/src/apps/cli/cli.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/cloudSQL/commandRestoreDb.js +106 -180
- package/dist/cli/src/apps/cli/commands/cloudSQL/commandRestoreDb.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/cloudSQL/index.js +4 -43
- package/dist/cli/src/apps/cli/commands/cloudSQL/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/general/index.js +67 -191
- package/dist/cli/src/apps/cli/commands/general/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/general/namespaceAutoCompletion.js +4 -49
- package/dist/cli/src/apps/cli/commands/general/namespaceAutoCompletion.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/general/portForward.js +36 -93
- package/dist/cli/src/apps/cli/commands/general/portForward.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/index.js +8 -47
- package/dist/cli/src/apps/cli/commands/mongodb/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoDestroyMember.js +86 -183
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoGetShell.js +30 -90
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoGetShell.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoPortForward.js +50 -114
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/utils/index.js +58 -192
- package/dist/cli/src/apps/cli/commands/mongodb/utils/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js +118 -197
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js +81 -160
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js +134 -397
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandDeletePods.js +40 -140
- package/dist/cli/src/apps/cli/commands/project/commandDeletePods.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandDeleteProject.js +23 -92
- package/dist/cli/src/apps/cli/commands/project/commandDeleteProject.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandEnvVars.js +10 -71
- package/dist/cli/src/apps/cli/commands/project/commandEnvVars.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandGetMyTotalWorktime.js +7 -54
- package/dist/cli/src/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandGetShell.js +27 -89
- package/dist/cli/src/apps/cli/commands/project/commandGetShell.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandGitlabCi.js +65 -180
- package/dist/cli/src/apps/cli/commands/project/commandGitlabCi.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandListPods.js +13 -72
- package/dist/cli/src/apps/cli/commands/project/commandListPods.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandMigrateHelm3.js +38 -104
- package/dist/cli/src/apps/cli/commands/project/commandMigrateHelm3.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandNamespace.js +8 -67
- package/dist/cli/src/apps/cli/commands/project/commandNamespace.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenCostDashboard.js +16 -77
- package/dist/cli/src/apps/cli/commands/project/commandOpenCostDashboard.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenDashboard.js +18 -81
- package/dist/cli/src/apps/cli/commands/project/commandOpenDashboard.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenEnv.js +14 -74
- package/dist/cli/src/apps/cli/commands/project/commandOpenEnv.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenGit.js +6 -53
- package/dist/cli/src/apps/cli/commands/project/commandOpenGit.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenGrafana.js +16 -77
- package/dist/cli/src/apps/cli/commands/project/commandOpenGrafana.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenGrafanaPod.js +28 -93
- package/dist/cli/src/apps/cli/commands/project/commandOpenGrafanaPod.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenLogs.js +11 -71
- package/dist/cli/src/apps/cli/commands/project/commandOpenLogs.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandPauseProject.js +23 -92
- package/dist/cli/src/apps/cli/commands/project/commandPauseProject.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandPortForward.js +71 -163
- package/dist/cli/src/apps/cli/commands/project/commandPortForward.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.js +6 -55
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandSecretsClearBackups.js +17 -112
- package/dist/cli/src/apps/cli/commands/project/commandSecretsClearBackups.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandSecurityEvaluate.js +15 -66
- package/dist/cli/src/apps/cli/commands/project/commandSecurityEvaluate.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandSetup.js +6 -55
- package/dist/cli/src/apps/cli/commands/project/commandSetup.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandTriggerCronjob.js +47 -135
- package/dist/cli/src/apps/cli/commands/project/commandTriggerCronjob.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/index.js +54 -93
- package/dist/cli/src/apps/cli/commands/project/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/index.js +39 -127
- package/dist/cli/src/apps/cli/commands/project/setup/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js +35 -100
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js +52 -129
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js +19 -68
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js +106 -147
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupTopic.js +7 -80
- package/dist/cli/src/apps/cli/commands/project/setup/setupTopic.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.js +16 -105
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js +28 -79
- package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js +32 -89
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/showProjectBanner.js +9 -53
- package/dist/cli/src/apps/cli/commands/project/utils/showProjectBanner.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/theStuffThatReallyMatters/index.js +26 -92
- package/dist/cli/src/apps/cli/commands/theStuffThatReallyMatters/index.js.map +1 -1
- package/dist/cli/src/apps/cli/utils/getGoogleAuthUserNumber.js +13 -62
- package/dist/cli/src/apps/cli/utils/getGoogleAuthUserNumber.js.map +1 -1
- package/dist/cli/src/apps/cli/verify/index.js +10 -62
- package/dist/cli/src/apps/cli/verify/index.js.map +1 -1
- package/dist/cli/src/catci.js +1 -1
- package/dist/cli/src/catci.js.map +1 -1
- package/dist/cli/src/catenv.js +8 -8
- package/dist/cli/src/catenv.js.map +1 -1
- package/dist/cli/src/cli.js +1 -1
- package/dist/cli/src/cli.js.map +1 -1
- package/dist/cli/src/config/getProjectConfig.js +118 -278
- package/dist/cli/src/config/getProjectConfig.js.map +1 -1
- package/dist/cli/src/config/parseChoice.js +3 -19
- package/dist/cli/src/config/parseChoice.js.map +1 -1
- package/dist/cli/src/gcloud/artifactsRegistry.js +10 -54
- package/dist/cli/src/gcloud/artifactsRegistry.js.map +1 -1
- package/dist/cli/src/gcloud/cloudRun/getCloudRunDomainSuffix.js +21 -60
- package/dist/cli/src/gcloud/cloudRun/getCloudRunDomainSuffix.js.map +1 -1
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js +12 -57
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js.map +1 -1
- package/dist/cli/src/gcloud/cloudSql/copyDb.js +30 -56
- package/dist/cli/src/gcloud/cloudSql/copyDb.js.map +1 -1
- package/dist/cli/src/gcloud/cloudSql/startProxy.js +41 -123
- package/dist/cli/src/gcloud/cloudSql/startProxy.js.map +1 -1
- package/dist/cli/src/gcloud/enableServices.js +6 -82
- package/dist/cli/src/gcloud/enableServices.js.map +1 -1
- package/dist/cli/src/gcloud/openDashboard.js +12 -95
- package/dist/cli/src/gcloud/openDashboard.js.map +1 -1
- package/dist/cli/src/gcloud/serviceAccounts.js +63 -186
- package/dist/cli/src/gcloud/serviceAccounts.js.map +1 -1
- package/dist/cli/src/k8sApi/index.js +9 -9
- package/dist/cli/src/k8sApi/index.js.map +1 -1
- package/dist/cli/src/kubernetes/index.js +20 -81
- package/dist/cli/src/kubernetes/index.js.map +1 -1
- package/dist/cli/src/kubernetes/openKubernetesDashboards.js +32 -86
- package/dist/cli/src/kubernetes/openKubernetesDashboards.js.map +1 -1
- package/dist/cli/src/kubernetes/portForward.js +5 -50
- package/dist/cli/src/kubernetes/portForward.js.map +1 -1
- package/dist/cli/src/packageInfos.js +2 -2
- package/dist/cli/src/packageInfos.js.map +1 -1
- package/dist/cli/src/utils/boxWithAscii.js +6 -6
- package/dist/cli/src/utils/boxWithAscii.js.map +1 -1
- package/dist/cli/src/utils/cluster.js +8 -61
- package/dist/cli/src/utils/cluster.js.map +1 -1
- package/dist/cli/src/utils/editAsFile.js +21 -75
- package/dist/cli/src/utils/editAsFile.js.map +1 -1
- package/dist/cli/src/utils/files.js +11 -57
- package/dist/cli/src/utils/files.js.map +1 -1
- package/dist/cli/src/utils/getEditor.js +15 -71
- package/dist/cli/src/utils/getEditor.js.map +1 -1
- package/dist/cli/src/utils/gitlab.js +176 -466
- package/dist/cli/src/utils/gitlab.js.map +1 -1
- package/dist/cli/src/utils/log.js +2 -2
- package/dist/cli/src/utils/log.js.map +1 -1
- package/dist/cli/src/utils/portForwards.js +32 -120
- package/dist/cli/src/utils/portForwards.js.map +1 -1
- package/dist/cli/src/utils/preferences/index.js +27 -108
- package/dist/cli/src/utils/preferences/index.js.map +1 -1
- package/dist/cli/src/utils/projects/index.js +28 -116
- package/dist/cli/src/utils/projects/index.js.map +1 -1
- package/dist/cli/src/utils/promise.js +4 -55
- package/dist/cli/src/utils/promise.js.map +1 -1
- package/dist/cli/src/utils/shell.js +19 -75
- package/dist/cli/src/utils/shell.js.map +1 -1
- package/dist/pipeline/src/bash/BashExpression.js +20 -52
- package/dist/pipeline/src/bash/BashExpression.js.map +1 -1
- package/dist/pipeline/src/bash/bashExpressionPerPipelineType.js +1 -1
- package/dist/pipeline/src/bash/bashExpressionPerPipelineType.js.map +1 -1
- package/dist/pipeline/src/bash/bashYaml.js +13 -10
- package/dist/pipeline/src/bash/bashYaml.js.map +1 -1
- package/dist/pipeline/src/bash/getInjectVarsScript.js +5 -27
- package/dist/pipeline/src/bash/getInjectVarsScript.js.map +1 -1
- package/dist/pipeline/src/bash/replaceAsync.js +29 -79
- package/dist/pipeline/src/bash/replaceAsync.js.map +1 -1
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js +29 -60
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js.map +1 -1
- package/dist/pipeline/src/build/base/createAppBuildJob.js +40 -72
- package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/pipeline/src/build/base/createArtifactsConfig.js +11 -40
- package/dist/pipeline/src/build/base/createArtifactsConfig.js.map +1 -1
- package/dist/pipeline/src/build/base/index.js +36 -62
- package/dist/pipeline/src/build/base/index.js.map +1 -1
- package/dist/pipeline/src/build/base/writeBuildInfo.js +2 -2
- package/dist/pipeline/src/build/base/writeBuildInfo.js.map +1 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js +13 -36
- package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
- package/dist/pipeline/src/build/custom/buildJob.js +8 -33
- package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/custom/index.js +4 -29
- package/dist/pipeline/src/build/custom/index.js.map +1 -1
- package/dist/pipeline/src/build/custom/testJob.js +41 -50
- package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
- package/dist/pipeline/src/build/docker.js +72 -104
- package/dist/pipeline/src/build/docker.js.map +1 -1
- package/dist/pipeline/src/build/index.js +17 -17
- package/dist/pipeline/src/build/index.js.map +1 -1
- package/dist/pipeline/src/build/node/buildJob.js +24 -45
- package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/node/cache.js +31 -54
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/pipeline/src/build/node/index.js +9 -34
- package/dist/pipeline/src/build/node/index.js.map +1 -1
- package/dist/pipeline/src/build/node/meteor.js +16 -40
- package/dist/pipeline/src/build/node/meteor.js.map +1 -1
- package/dist/pipeline/src/build/node/testJob.js +69 -66
- package/dist/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/pipeline/src/build/node/yarn.js +35 -51
- package/dist/pipeline/src/build/node/yarn.js.map +1 -1
- package/dist/pipeline/src/build/rails/build.js +22 -57
- package/dist/pipeline/src/build/rails/build.js.map +1 -1
- package/dist/pipeline/src/build/rails/index.js +4 -29
- package/dist/pipeline/src/build/rails/index.js.map +1 -1
- package/dist/pipeline/src/build/rails/test.js +60 -66
- package/dist/pipeline/src/build/rails/test.js.map +1 -1
- package/dist/pipeline/src/build/sbom.js +12 -12
- package/dist/pipeline/src/build/sbom.js.map +1 -1
- package/dist/pipeline/src/build/types.js +2 -6
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/config/configruedEnvs.js +18 -47
- package/dist/pipeline/src/config/configruedEnvs.js.map +1 -1
- package/dist/pipeline/src/config/readConfig.js +26 -101
- package/dist/pipeline/src/config/readConfig.js.map +1 -1
- package/dist/pipeline/src/context/createAllComponentsContext.js +16 -63
- package/dist/pipeline/src/context/createAllComponentsContext.js.map +1 -1
- package/dist/pipeline/src/context/createComponentContext.js +93 -170
- package/dist/pipeline/src/context/createComponentContext.js.map +1 -1
- package/dist/pipeline/src/context/createWorkspaceContext.js +30 -80
- package/dist/pipeline/src/context/createWorkspaceContext.js.map +1 -1
- package/dist/pipeline/src/context/getBuildInfoVariables.js +12 -31
- package/dist/pipeline/src/context/getBuildInfoVariables.js.map +1 -1
- package/dist/pipeline/src/context/getEnvConfig.js +4 -4
- package/dist/pipeline/src/context/getEnvConfig.js.map +1 -1
- package/dist/pipeline/src/context/getEnvType.js +2 -2
- package/dist/pipeline/src/context/getEnvType.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironment.js +17 -64
- package/dist/pipeline/src/context/getEnvironment.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentContext.js +21 -22
- package/dist/pipeline/src/context/getEnvironmentContext.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.js +109 -169
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/context/getLabels.js +12 -15
- package/dist/pipeline/src/context/getLabels.js.map +1 -1
- package/dist/pipeline/src/context/getReviewSlug.js +7 -7
- package/dist/pipeline/src/context/getReviewSlug.js.map +1 -1
- package/dist/pipeline/src/context/resolveReferences.js +51 -172
- package/dist/pipeline/src/context/resolveReferences.js.map +1 -1
- package/dist/pipeline/src/context/transformJobOnlyVars.js +22 -69
- package/dist/pipeline/src/context/transformJobOnlyVars.js.map +1 -1
- package/dist/pipeline/src/context/utils/envVars.js +13 -39
- package/dist/pipeline/src/context/utils/envVars.js.map +1 -1
- package/dist/pipeline/src/deploy/base/deploy.js +60 -82
- package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
- package/dist/pipeline/src/deploy/base/index.js +11 -34
- package/dist/pipeline/src/deploy/base/index.js.map +1 -1
- package/dist/pipeline/src/deploy/base/rollback.js +11 -15
- package/dist/pipeline/src/deploy/base/rollback.js.map +1 -1
- package/dist/pipeline/src/deploy/base/stop.js +11 -15
- package/dist/pipeline/src/deploy/base/stop.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js +41 -64
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/cleanup.js +8 -33
- package/dist/pipeline/src/deploy/cloudRun/cleanup.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js +25 -30
- package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js +92 -136
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js +44 -61
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js +25 -53
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +36 -47
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js +22 -39
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js +27 -33
- package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/volumes.js +7 -34
- package/dist/pipeline/src/deploy/cloudRun/createJobs/volumes.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/index.js +38 -75
- package/dist/pipeline/src/deploy/cloudRun/index.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/createArgsString.js +14 -42
- package/dist/pipeline/src/deploy/cloudRun/utils/createArgsString.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/database.js +14 -30
- package/dist/pipeline/src/deploy/cloudRun/utils/database.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +5 -5
- package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.js +1 -3
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/jobName.js +1 -3
- package/dist/pipeline/src/deploy/cloudRun/utils/jobName.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.js +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudSql/utils.js +4 -4
- package/dist/pipeline/src/deploy/cloudSql/utils.js.map +1 -1
- package/dist/pipeline/src/deploy/custom/deployJob.js +18 -37
- package/dist/pipeline/src/deploy/custom/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/custom/index.js +4 -4
- package/dist/pipeline/src/deploy/custom/index.js.map +1 -1
- package/dist/pipeline/src/deploy/dockerTag/deployJob.js +16 -48
- package/dist/pipeline/src/deploy/dockerTag/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/dockerTag/index.js +4 -4
- package/dist/pipeline/src/deploy/dockerTag/index.js.map +1 -1
- package/dist/pipeline/src/deploy/index.js +4 -4
- package/dist/pipeline/src/deploy/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/additionalSecretKeys.js +6 -7
- package/dist/pipeline/src/deploy/kubernetes/additionalSecretKeys.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js +13 -13
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js +64 -72
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/index.js +21 -47
- package/dist/pipeline/src/deploy/kubernetes/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js +13 -36
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +23 -60
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/mongodb.js +38 -48
- package/dist/pipeline/src/deploy/kubernetes/mongodb.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js +15 -17
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js.map +1 -1
- package/dist/pipeline/src/deploy/sbom.js +9 -11
- package/dist/pipeline/src/deploy/sbom.js.map +1 -1
- package/dist/pipeline/src/deploy/types/googleCloudRun.d.ts +8 -0
- package/dist/pipeline/src/deploy/types/index.js +1 -5
- package/dist/pipeline/src/deploy/types/index.js.map +1 -1
- package/dist/pipeline/src/deploy/utils.js +7 -7
- package/dist/pipeline/src/deploy/utils.js.map +1 -1
- package/dist/pipeline/src/packageInfos.js +2 -2
- package/dist/pipeline/src/packageInfos.js.map +1 -1
- package/dist/pipeline/src/pipeline/createAllJobs.js +39 -132
- package/dist/pipeline/src/pipeline/createAllJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/createChildPipeline.js +24 -71
- package/dist/pipeline/src/pipeline/createChildPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.js +18 -62
- package/dist/pipeline/src/pipeline/createJobsForComponent.js.map +1 -1
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.js +3 -3
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.js.map +1 -1
- package/dist/pipeline/src/pipeline/createMainPipeline.js +57 -141
- package/dist/pipeline/src/pipeline/createMainPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js +43 -137
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js.map +1 -1
- package/dist/pipeline/src/pipeline/getPipelineStages.js +8 -31
- package/dist/pipeline/src/pipeline/getPipelineStages.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js +150 -216
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.js +14 -26
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.js +11 -11
- package/dist/pipeline/src/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js +8 -9
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/sortGitLabJobDefProps.js +11 -20
- package/dist/pipeline/src/pipeline/gitlab/sortGitLabJobDefProps.js.map +1 -1
- package/dist/pipeline/src/pipeline/packageManager.js +59 -133
- package/dist/pipeline/src/pipeline/packageManager.js.map +1 -1
- package/dist/pipeline/src/pipeline/yarn/yarnUtils.js +30 -120
- package/dist/pipeline/src/pipeline/yarn/yarnUtils.js.map +1 -1
- package/dist/pipeline/src/runner/index.js +2 -4
- package/dist/pipeline/src/runner/index.js.map +1 -1
- package/dist/pipeline/src/types/config.js +4 -28
- package/dist/pipeline/src/types/config.js.map +1 -1
- package/dist/pipeline/src/types/context.js +2 -2
- package/dist/pipeline/src/types/context.js.map +1 -1
- package/dist/pipeline/src/utils/gitlab.js +19 -42
- package/dist/pipeline/src/utils/gitlab.js.map +1 -1
- package/dist/pipeline/src/utils/index.js +6 -34
- package/dist/pipeline/src/utils/index.js.map +1 -1
- package/dist/pipeline/src/utils/jsonParse.js +2 -2
- package/dist/pipeline/src/utils/jsonParse.js.map +1 -1
- package/dist/pipeline/src/utils/removeUndefined.js +1 -22
- package/dist/pipeline/src/utils/removeUndefined.js.map +1 -1
- package/dist/pipeline/src/utils/writeFiles.js +17 -68
- package/dist/pipeline/src/utils/writeFiles.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/tsconfig.json +2 -2
|
@@ -6,104 +6,32 @@
|
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
8
8
|
|
|
9
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
10
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
11
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
13
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
14
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
15
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
19
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
20
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
21
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
22
|
-
function step(op) {
|
|
23
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
24
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
25
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
26
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
27
|
-
switch (op[0]) {
|
|
28
|
-
case 0: case 1: t = op; break;
|
|
29
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
30
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
31
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
32
|
-
default:
|
|
33
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
34
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
35
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
36
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
37
|
-
if (t[2]) _.ops.pop();
|
|
38
|
-
_.trys.pop(); continue;
|
|
39
|
-
}
|
|
40
|
-
op = body.call(thisArg, _);
|
|
41
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
42
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
46
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
47
|
-
if (!m) return o;
|
|
48
|
-
var i = m.call(o), r, ar = [], e;
|
|
49
|
-
try {
|
|
50
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
51
|
-
}
|
|
52
|
-
catch (error) { e = { error: error }; }
|
|
53
|
-
finally {
|
|
54
|
-
try {
|
|
55
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
56
|
-
}
|
|
57
|
-
finally { if (e) throw e.error; }
|
|
58
|
-
}
|
|
59
|
-
return ar;
|
|
60
|
-
};
|
|
61
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
62
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
63
|
-
if (ar || !(i in from)) {
|
|
64
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
65
|
-
ar[i] = from[i];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
69
|
-
};
|
|
70
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
71
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
72
11
|
};
|
|
73
12
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
74
13
|
exports.runCatCi = void 0;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
14
|
+
const vorpal_1 = __importDefault(__nccwpck_require__(1491));
|
|
15
|
+
const packageInfos_1 = __importDefault(__nccwpck_require__(2260));
|
|
16
|
+
const commands_1 = __importDefault(__nccwpck_require__(4288));
|
|
78
17
|
function reconstructArgs(args) {
|
|
79
|
-
return
|
|
18
|
+
return [args[0], ...args.slice(1).map((arg) => `"${arg}"`)].join(" ");
|
|
80
19
|
}
|
|
81
|
-
function runCatCi() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
process.exitCode = 1;
|
|
97
|
-
args = reconstructArgs(process.argv.slice(2));
|
|
98
|
-
return [4 /*yield*/, vorpal.exec(args)];
|
|
99
|
-
case 2:
|
|
100
|
-
_a.sent();
|
|
101
|
-
process.exit();
|
|
102
|
-
_a.label = 3;
|
|
103
|
-
case 3: return [2 /*return*/];
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
});
|
|
20
|
+
async function runCatCi() {
|
|
21
|
+
const vorpal = new vorpal_1.default();
|
|
22
|
+
process.exitCode = 0;
|
|
23
|
+
vorpal.delimiter("catci $").history("catci").version(packageInfos_1.default.version);
|
|
24
|
+
(0, commands_1.default)(vorpal);
|
|
25
|
+
const isInteractive = process.argv.length <= 2;
|
|
26
|
+
if (isInteractive) {
|
|
27
|
+
vorpal.log(`Catladder CI Tools 😻🔨 version ${packageInfos_1.default.version}`).show();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
const args = reconstructArgs(process.argv.slice(2));
|
|
32
|
+
await vorpal.exec(args);
|
|
33
|
+
process.exit();
|
|
34
|
+
}
|
|
107
35
|
}
|
|
108
36
|
exports.runCatCi = runCatCi;
|
|
109
37
|
//# sourceMappingURL=catci.js.map
|
|
@@ -115,115 +43,109 @@ exports.runCatCi = runCatCi;
|
|
|
115
43
|
|
|
116
44
|
"use strict";
|
|
117
45
|
|
|
118
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
119
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
120
|
-
if (!m) return o;
|
|
121
|
-
var i = m.call(o), r, ar = [], e;
|
|
122
|
-
try {
|
|
123
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
124
|
-
}
|
|
125
|
-
catch (error) { e = { error: error }; }
|
|
126
|
-
finally {
|
|
127
|
-
try {
|
|
128
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
129
|
-
}
|
|
130
|
-
finally { if (e) throw e.error; }
|
|
131
|
-
}
|
|
132
|
-
return ar;
|
|
133
|
-
};
|
|
134
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
135
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
136
|
-
if (ar || !(i in from)) {
|
|
137
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
138
|
-
ar[i] = from[i];
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
142
|
-
};
|
|
143
46
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
144
47
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
145
48
|
};
|
|
146
49
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
147
50
|
exports.evaluateDocument = exports.makeTemplate = void 0;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
51
|
+
const topics_json_1 = __importDefault(__nccwpck_require__(1888));
|
|
52
|
+
const allTopics = topics_json_1.default;
|
|
53
|
+
const checkYes = "✅";
|
|
54
|
+
const checkNo = "❌";
|
|
55
|
+
const checkPlaceholder = `${checkYes}/${checkNo}`;
|
|
56
|
+
const responsiblePlaceholder = "@...";
|
|
57
|
+
const rows = [
|
|
155
58
|
["Responsible", checkPlaceholder, "Description", "Note", "More Information"],
|
|
156
|
-
].concat(allTopics.map(
|
|
59
|
+
].concat(allTopics.map((t) => [
|
|
157
60
|
Array(t.responsibles).fill(responsiblePlaceholder).join(", "),
|
|
158
61
|
checkPlaceholder,
|
|
159
62
|
t.description,
|
|
160
63
|
"",
|
|
161
64
|
t.more,
|
|
162
|
-
]
|
|
65
|
+
]));
|
|
163
66
|
function makeTable(rows) {
|
|
164
|
-
|
|
165
|
-
return
|
|
67
|
+
const colWidths = calculateColumnWidths(rows);
|
|
68
|
+
return `
|
|
69
|
+
${makeRow(rows[0], colWidths, " ")}
|
|
70
|
+
${makeRow(rows[0].map(() => ""), colWidths, "-")}
|
|
71
|
+
${rows
|
|
166
72
|
.slice(1)
|
|
167
|
-
.map(
|
|
168
|
-
.join("\n")
|
|
73
|
+
.map((row) => makeRow(row, colWidths, " "))
|
|
74
|
+
.join("\n")}
|
|
75
|
+
`;
|
|
169
76
|
}
|
|
170
77
|
function calculateColumnWidths(rows) {
|
|
171
|
-
|
|
172
|
-
return Array.from({ length: columnCount },
|
|
173
|
-
return Math.max.apply(Math, __spreadArray([], __read(rows.map(function (row) { return row[columnIndex].length; })), false));
|
|
174
|
-
});
|
|
78
|
+
const columnCount = rows[0].length;
|
|
79
|
+
return Array.from({ length: columnCount }, (_, i) => i).map((columnIndex) => Math.max(...rows.map((row) => row[columnIndex].length)));
|
|
175
80
|
}
|
|
176
81
|
function makeRow(row, colWidths, fillString) {
|
|
177
|
-
return
|
|
178
|
-
.map(
|
|
179
|
-
.join(" | ")
|
|
82
|
+
return `| ${row
|
|
83
|
+
.map((cell, i) => cell.padEnd(colWidths[i], fillString))
|
|
84
|
+
.join(" | ")} |`;
|
|
180
85
|
}
|
|
181
86
|
function makeTemplate() {
|
|
182
|
-
return
|
|
87
|
+
return `
|
|
88
|
+
# Security Audit Report
|
|
89
|
+
|
|
90
|
+
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.
|
|
91
|
+
|
|
92
|
+
It serves as a structured guide for security team to evaluate different security factors such as authentication, authorization, data encryption, input validation, and more.
|
|
93
|
+
|
|
94
|
+
## General Information
|
|
95
|
+
|
|
96
|
+
- Project Owner is @...
|
|
97
|
+
- Dev team:
|
|
98
|
+
- @...
|
|
99
|
+
- @...
|
|
100
|
+
- @...
|
|
101
|
+
|
|
102
|
+
## Project Security
|
|
103
|
+
|
|
104
|
+
${makeTable(rows)}
|
|
105
|
+
|
|
106
|
+
`;
|
|
183
107
|
}
|
|
184
108
|
exports.makeTemplate = makeTemplate;
|
|
185
109
|
function evaluateDocument(document) {
|
|
186
110
|
var _a, _b;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
.map(
|
|
111
|
+
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 : [];
|
|
112
|
+
const matchedRows = rawRows
|
|
113
|
+
.map((row) => row.split("|").map((col) => col.trim()))
|
|
190
114
|
.slice(2);
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
115
|
+
const knownTopics = new Set(allTopics.map((t) => t.description));
|
|
116
|
+
const topics = matchedRows.map((col) => {
|
|
117
|
+
const responsibles = col[1].split(", ");
|
|
118
|
+
const answer = col[2];
|
|
119
|
+
const description = col[3];
|
|
120
|
+
const note = col[4];
|
|
121
|
+
const isUnknown = !knownTopics.has(description);
|
|
122
|
+
const isAnswered = !isUnknown &&
|
|
199
123
|
!answer.includes(checkPlaceholder) &&
|
|
200
|
-
!responsibles.some(
|
|
201
|
-
|
|
202
|
-
});
|
|
203
|
-
var isSecured = !isUnknown && isAnswered && answer.includes(checkYes);
|
|
124
|
+
!responsibles.some((responsible) => responsible.includes(responsiblePlaceholder));
|
|
125
|
+
const isSecured = !isUnknown && isAnswered && answer.includes(checkYes);
|
|
204
126
|
return {
|
|
205
|
-
responsibles
|
|
206
|
-
answer
|
|
207
|
-
description
|
|
208
|
-
note
|
|
209
|
-
isUnknown
|
|
210
|
-
isAnswered
|
|
211
|
-
isSecured
|
|
127
|
+
responsibles,
|
|
128
|
+
answer,
|
|
129
|
+
description,
|
|
130
|
+
note,
|
|
131
|
+
isUnknown,
|
|
132
|
+
isAnswered,
|
|
133
|
+
isSecured,
|
|
212
134
|
};
|
|
213
135
|
});
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
136
|
+
const totalTopics = allTopics.length;
|
|
137
|
+
const answeredTopics = topics.filter((t) => t.isAnswered).length;
|
|
138
|
+
const securedTopics = topics.filter((t) => t.isSecured).length;
|
|
139
|
+
const unknownTopics = topics.filter((t) => t.isUnknown).length;
|
|
140
|
+
const rating = Math.round((securedTopics / totalTopics) * 100);
|
|
219
141
|
return {
|
|
220
|
-
topics
|
|
142
|
+
topics,
|
|
221
143
|
score: {
|
|
222
|
-
rating
|
|
223
|
-
totalTopics
|
|
224
|
-
answeredTopics
|
|
225
|
-
securedTopics
|
|
226
|
-
unknownTopics
|
|
144
|
+
rating,
|
|
145
|
+
totalTopics,
|
|
146
|
+
answeredTopics,
|
|
147
|
+
securedTopics,
|
|
148
|
+
unknownTopics,
|
|
227
149
|
},
|
|
228
150
|
};
|
|
229
151
|
}
|
|
@@ -233,52 +155,16 @@ exports.evaluateDocument = evaluateDocument;
|
|
|
233
155
|
/***/ }),
|
|
234
156
|
|
|
235
157
|
/***/ 4288:
|
|
236
|
-
/***/ (
|
|
158
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
237
159
|
|
|
238
160
|
"use strict";
|
|
239
161
|
|
|
240
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
241
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
242
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
243
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
244
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
245
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
246
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
247
|
-
});
|
|
248
|
-
};
|
|
249
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
250
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
251
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
252
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
253
|
-
function step(op) {
|
|
254
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
255
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
256
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
257
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
258
|
-
switch (op[0]) {
|
|
259
|
-
case 0: case 1: t = op; break;
|
|
260
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
261
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
262
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
263
|
-
default:
|
|
264
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
265
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
266
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
267
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
268
|
-
if (t[2]) _.ops.pop();
|
|
269
|
-
_.trys.pop(); continue;
|
|
270
|
-
}
|
|
271
|
-
op = body.call(thisArg, _);
|
|
272
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
273
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
162
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
163
|
+
const evaluateSecurityAudit_1 = __nccwpck_require__(6725);
|
|
164
|
+
const rest_1 = __nccwpck_require__(1084);
|
|
165
|
+
const createSecurityAuditMergeRequest_1 = __nccwpck_require__(8933);
|
|
166
|
+
const ts_results_es_1 = __nccwpck_require__(2807);
|
|
167
|
+
const GITLAB_HOST = "https://git.panter.ch";
|
|
282
168
|
function default_1(vorpal) {
|
|
283
169
|
commandCiJob(vorpal);
|
|
284
170
|
commandEvaluate(vorpal);
|
|
@@ -286,257 +172,158 @@ function default_1(vorpal) {
|
|
|
286
172
|
}
|
|
287
173
|
exports["default"] = default_1;
|
|
288
174
|
function resultAsExitCode(func) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
175
|
+
return async (args) => {
|
|
176
|
+
const result = await func(args);
|
|
177
|
+
process.exitCode = result.isErr() ? 1 : 0;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
async function commandCiJob(vorpal) {
|
|
181
|
+
vorpal
|
|
182
|
+
.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.
|
|
183
|
+
|
|
184
|
+
<path> root path of a project with security audit document (${createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME})
|
|
185
|
+
<token> gitlab token with 'api' scopes and permissions to create a new branch
|
|
186
|
+
<main-branch> main branch name
|
|
187
|
+
<project-id> project id to create security audit for
|
|
188
|
+
<user-id> gitlab user id that will be assignee of the audit
|
|
189
|
+
`)
|
|
190
|
+
.action(resultAsExitCode(async (args) => {
|
|
191
|
+
const evaluation = await (0, evaluateSecurityAudit_1.evaluateSecurityAudit)({ path: args.path });
|
|
192
|
+
if (evaluation.isErr()) {
|
|
193
|
+
console.log("could not evaluate security audit document");
|
|
194
|
+
console.log("creating new merge request with security audit template...");
|
|
195
|
+
const { token, mainBranch, projectId, userId } = args;
|
|
196
|
+
const api = new rest_1.Gitlab({
|
|
197
|
+
host: GITLAB_HOST,
|
|
198
|
+
token,
|
|
199
|
+
});
|
|
200
|
+
const mr = await (0, createSecurityAuditMergeRequest_1.createSecurityAuditMergeRequest)({
|
|
201
|
+
api,
|
|
202
|
+
mainBranch,
|
|
203
|
+
projectId,
|
|
204
|
+
userId: parseInt(userId),
|
|
205
|
+
});
|
|
206
|
+
if (mr.isErr()) {
|
|
207
|
+
console.error(`could not create merge request with security audit template: ${mr.error}`);
|
|
208
|
+
return mr;
|
|
299
209
|
}
|
|
300
|
-
|
|
301
|
-
|
|
210
|
+
console.log("security audit merge request created successfully");
|
|
211
|
+
console.log(`please finish the MR by updating SECURITY.md document: ${mr.value.web_url}`);
|
|
212
|
+
return (0, ts_results_es_1.Err)("merge request created");
|
|
213
|
+
}
|
|
214
|
+
if (evaluation.value.score.answeredTopics === 0) {
|
|
215
|
+
console.error("audit document has no answered topics");
|
|
216
|
+
console.error(`please answer security topics in ${createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME} by adding responsible people and check/cross in the table`);
|
|
217
|
+
return (0, ts_results_es_1.Err)("audit document has no answered topics");
|
|
218
|
+
}
|
|
219
|
+
console.log((0, evaluateSecurityAudit_1.makeSecurityAuditOverview)(evaluation.value));
|
|
220
|
+
return (0, ts_results_es_1.Ok)({});
|
|
221
|
+
}));
|
|
302
222
|
}
|
|
303
|
-
function
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
console.log("creating new merge request with security audit template...");
|
|
319
|
-
token = args.token, mainBranch = args.mainBranch, projectId = args.projectId, userId = args.userId;
|
|
320
|
-
api = new rest_1.Gitlab({
|
|
321
|
-
host: GITLAB_HOST,
|
|
322
|
-
token: token,
|
|
323
|
-
});
|
|
324
|
-
return [4 /*yield*/, (0, createSecurityAuditMergeRequest_1.createSecurityAuditMergeRequest)({
|
|
325
|
-
api: api,
|
|
326
|
-
mainBranch: mainBranch,
|
|
327
|
-
projectId: projectId,
|
|
328
|
-
userId: parseInt(userId),
|
|
329
|
-
})];
|
|
330
|
-
case 2:
|
|
331
|
-
mr = _a.sent();
|
|
332
|
-
if (mr.isErr()) {
|
|
333
|
-
console.error("could not create merge request with security audit template: ".concat(mr.error));
|
|
334
|
-
return [2 /*return*/, mr];
|
|
335
|
-
}
|
|
336
|
-
console.log("security audit merge request created successfully");
|
|
337
|
-
console.log("please finish the MR by updating SECURITY.md document: ".concat(mr.value.web_url));
|
|
338
|
-
return [2 /*return*/, (0, ts_results_es_1.Err)("merge request created")];
|
|
339
|
-
case 3:
|
|
340
|
-
if (evaluation.value.score.answeredTopics === 0) {
|
|
341
|
-
console.error("audit document has no answered topics");
|
|
342
|
-
console.error("please answer security topics in ".concat(createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME, " by adding responsible people and check/cross in the table"));
|
|
343
|
-
return [2 /*return*/, (0, ts_results_es_1.Err)("audit document has no answered topics")];
|
|
344
|
-
}
|
|
345
|
-
console.log((0, evaluateSecurityAudit_1.makeSecurityAuditOverview)(evaluation.value));
|
|
346
|
-
return [2 /*return*/, (0, ts_results_es_1.Ok)({})];
|
|
347
|
-
}
|
|
348
|
-
});
|
|
349
|
-
}); }));
|
|
350
|
-
return [2 /*return*/];
|
|
351
|
-
});
|
|
352
|
-
});
|
|
223
|
+
async function commandEvaluate(vorpal) {
|
|
224
|
+
vorpal
|
|
225
|
+
.command("security-audit-evaluate <path>", "Evaluates security audit document in given <path>")
|
|
226
|
+
.action(resultAsExitCode(async (args) => {
|
|
227
|
+
console.log("evaluating security audit document...");
|
|
228
|
+
const result = await (0, evaluateSecurityAudit_1.evaluateSecurityAudit)({ path: args.path });
|
|
229
|
+
if (result.isErr()) {
|
|
230
|
+
console.error(result.error);
|
|
231
|
+
console.error(`please make sure the security audit document ${createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME} is in the repository`);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
console.log((0, evaluateSecurityAudit_1.makeSecurityAuditOverview)(result.value));
|
|
235
|
+
}
|
|
236
|
+
return result;
|
|
237
|
+
}));
|
|
353
238
|
}
|
|
354
|
-
function
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
result = _a.sent();
|
|
369
|
-
if (result.isErr()) {
|
|
370
|
-
console.error(result.error);
|
|
371
|
-
console.error("please make sure the security audit document ".concat(createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME, " is in the repository"));
|
|
372
|
-
}
|
|
373
|
-
else {
|
|
374
|
-
console.log((0, evaluateSecurityAudit_1.makeSecurityAuditOverview)(result.value));
|
|
375
|
-
}
|
|
376
|
-
return [2 /*return*/, result];
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
}); }));
|
|
380
|
-
return [2 /*return*/];
|
|
239
|
+
async function commandCreate(vorpal) {
|
|
240
|
+
vorpal
|
|
241
|
+
.command("security-audit-create <token> <mainBranch> <projectId> <userId>", `Creates a MR in given project with the latest security audit template document
|
|
242
|
+
|
|
243
|
+
<token> gitlab token with 'api' scopes and permissions to create a new branch
|
|
244
|
+
<main-branch> main branch name
|
|
245
|
+
<project-id> project id to create security audit for
|
|
246
|
+
<user-id> gitlab user id that will be assignee of the audit
|
|
247
|
+
`)
|
|
248
|
+
.action(resultAsExitCode(async (args) => {
|
|
249
|
+
const { token, mainBranch, projectId, userId } = args;
|
|
250
|
+
const api = new rest_1.Gitlab({
|
|
251
|
+
host: GITLAB_HOST,
|
|
252
|
+
token,
|
|
381
253
|
});
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
return __generator(this, function (_a) {
|
|
388
|
-
vorpal
|
|
389
|
-
.command("security-audit-create <token> <mainBranch> <projectId> <userId>", "Creates a MR in given project with the latest security audit template document\n\n<token> gitlab token with 'api' scopes and permissions to create a new branch\n<main-branch> main branch name\n<project-id> project id to create security audit for\n<user-id> gitlab user id that will be assignee of the audit\n")
|
|
390
|
-
.action(resultAsExitCode(function (args) { return __awaiter(_this, void 0, void 0, function () {
|
|
391
|
-
var token, mainBranch, projectId, userId, api, result;
|
|
392
|
-
return __generator(this, function (_a) {
|
|
393
|
-
switch (_a.label) {
|
|
394
|
-
case 0:
|
|
395
|
-
token = args.token, mainBranch = args.mainBranch, projectId = args.projectId, userId = args.userId;
|
|
396
|
-
api = new rest_1.Gitlab({
|
|
397
|
-
host: GITLAB_HOST,
|
|
398
|
-
token: token,
|
|
399
|
-
});
|
|
400
|
-
return [4 /*yield*/, (0, createSecurityAuditMergeRequest_1.createSecurityAuditMergeRequest)({
|
|
401
|
-
api: api,
|
|
402
|
-
mainBranch: mainBranch,
|
|
403
|
-
projectId: projectId,
|
|
404
|
-
userId: parseInt(userId),
|
|
405
|
-
})];
|
|
406
|
-
case 1:
|
|
407
|
-
result = _a.sent();
|
|
408
|
-
if (result.isErr()) {
|
|
409
|
-
console.error("could not create security audit merge request: ".concat(result.error));
|
|
410
|
-
}
|
|
411
|
-
else {
|
|
412
|
-
console.log("security audit merge request created successfully");
|
|
413
|
-
console.log("please finish the MR by updating SECURITY.md document: ".concat(result.value.web_url));
|
|
414
|
-
}
|
|
415
|
-
return [2 /*return*/, result];
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
|
-
}); }));
|
|
419
|
-
return [2 /*return*/];
|
|
254
|
+
const result = await (0, createSecurityAuditMergeRequest_1.createSecurityAuditMergeRequest)({
|
|
255
|
+
api,
|
|
256
|
+
mainBranch,
|
|
257
|
+
projectId,
|
|
258
|
+
userId: parseInt(userId),
|
|
420
259
|
});
|
|
421
|
-
|
|
260
|
+
if (result.isErr()) {
|
|
261
|
+
console.error(`could not create security audit merge request: ${result.error}`);
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
console.log("security audit merge request created successfully");
|
|
265
|
+
console.log(`please finish the MR by updating SECURITY.md document: ${result.value.web_url}`);
|
|
266
|
+
}
|
|
267
|
+
return result;
|
|
268
|
+
}));
|
|
422
269
|
}
|
|
423
270
|
//# sourceMappingURL=commands.js.map
|
|
424
271
|
|
|
425
272
|
/***/ }),
|
|
426
273
|
|
|
427
274
|
/***/ 8933:
|
|
428
|
-
/***/ (
|
|
275
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
429
276
|
|
|
430
277
|
"use strict";
|
|
431
278
|
|
|
432
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
433
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
434
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
435
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
436
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
437
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
438
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
439
|
-
});
|
|
440
|
-
};
|
|
441
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
442
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
443
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
444
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
445
|
-
function step(op) {
|
|
446
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
447
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
448
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
449
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
450
|
-
switch (op[0]) {
|
|
451
|
-
case 0: case 1: t = op; break;
|
|
452
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
453
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
454
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
455
|
-
default:
|
|
456
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
457
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
458
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
459
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
460
|
-
if (t[2]) _.ops.pop();
|
|
461
|
-
_.trys.pop(); continue;
|
|
462
|
-
}
|
|
463
|
-
op = body.call(thisArg, _);
|
|
464
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
465
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
466
|
-
}
|
|
467
|
-
};
|
|
468
279
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
469
280
|
exports.createSecurityAuditMergeRequest = exports.SECURITY_AUDIT_FILE_NAME = void 0;
|
|
470
|
-
|
|
471
|
-
|
|
281
|
+
const ts_results_es_1 = __nccwpck_require__(2807);
|
|
282
|
+
const auditDocument_1 = __nccwpck_require__(2488);
|
|
472
283
|
function makeDatedBranchName(branchName) {
|
|
473
|
-
|
|
474
|
-
return
|
|
284
|
+
const date = new Date().toISOString().slice(0, -5).replaceAll(/[:.T]/g, "-");
|
|
285
|
+
return `${branchName}-${date}`;
|
|
475
286
|
}
|
|
476
|
-
|
|
287
|
+
const MR_TITLE = "Draft: chore(security): add security audit document";
|
|
477
288
|
exports.SECURITY_AUDIT_FILE_NAME = "SECURITY.md";
|
|
478
|
-
function createSecurityAuditMergeRequest(
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
existingMr = mrs.value[0];
|
|
496
|
-
if (existingMr)
|
|
497
|
-
return [2 /*return*/, (0, ts_results_es_1.Err)("open merge request with security audit already exists: ".concat(existingMr.web_url))];
|
|
498
|
-
auditTemplate = ts_results_es_1.Result.wrap(function () { return (0, auditDocument_1.makeTemplate)(); }).mapErr(function () { return "could not make security audit template document"; });
|
|
499
|
-
if (auditTemplate.isErr())
|
|
500
|
-
return [2 /*return*/, auditTemplate];
|
|
501
|
-
return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () {
|
|
502
|
-
return api.Branches.create(projectId, makeDatedBranchName("chore/security-audit"), mainBranch);
|
|
503
|
-
})];
|
|
504
|
-
case 2:
|
|
505
|
-
branch = (_c.sent()).mapErr(function (e) {
|
|
506
|
-
console.log(e);
|
|
507
|
-
return "could not create branch";
|
|
508
|
-
});
|
|
509
|
-
if (branch.isErr())
|
|
510
|
-
return [2 /*return*/, branch];
|
|
511
|
-
return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () {
|
|
512
|
-
return api.Commits.create(projectId, branch.value.name, "chore(security): add empty security audit document template", [
|
|
513
|
-
{
|
|
514
|
-
action: "create",
|
|
515
|
-
filePath: exports.SECURITY_AUDIT_FILE_NAME,
|
|
516
|
-
content: auditTemplate.value,
|
|
517
|
-
encoding: "text",
|
|
518
|
-
},
|
|
519
|
-
]);
|
|
520
|
-
})];
|
|
521
|
-
case 3:
|
|
522
|
-
commit = (_c.sent()).mapErr(function () { return "could not create commit"; });
|
|
523
|
-
if (commit.isErr())
|
|
524
|
-
return [2 /*return*/, commit];
|
|
525
|
-
return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () {
|
|
526
|
-
return api.MergeRequests.create(projectId, branch.value.name, mainBranch, MR_TITLE, {
|
|
527
|
-
description: "Please follow and update security audit document in `".concat(exports.SECURITY_AUDIT_FILE_NAME, "`."),
|
|
528
|
-
assigneeId: userId,
|
|
529
|
-
squash: true,
|
|
530
|
-
labels: "security-audit",
|
|
531
|
-
removeSourceBranch: true,
|
|
532
|
-
});
|
|
533
|
-
})];
|
|
534
|
-
case 4:
|
|
535
|
-
mr = (_c.sent()).mapErr(function () { return "could not create merge request"; });
|
|
536
|
-
return [2 /*return*/, mr];
|
|
537
|
-
}
|
|
538
|
-
});
|
|
289
|
+
async function createSecurityAuditMergeRequest({ projectId, mainBranch, userId, api, }) {
|
|
290
|
+
const mrs = (await ts_results_es_1.Result.wrapAsync(() => api.MergeRequests.all({
|
|
291
|
+
state: "opened",
|
|
292
|
+
wip: "yes",
|
|
293
|
+
labels: "security-audit",
|
|
294
|
+
}))).mapErr(() => `could not search for existing merge requests`);
|
|
295
|
+
if (mrs.isErr())
|
|
296
|
+
return mrs;
|
|
297
|
+
const existingMr = mrs.value[0];
|
|
298
|
+
if (existingMr)
|
|
299
|
+
return (0, ts_results_es_1.Err)(`open merge request with security audit already exists: ${existingMr.web_url}`);
|
|
300
|
+
const auditTemplate = ts_results_es_1.Result.wrap(() => (0, auditDocument_1.makeTemplate)()).mapErr(() => "could not make security audit template document");
|
|
301
|
+
if (auditTemplate.isErr())
|
|
302
|
+
return auditTemplate;
|
|
303
|
+
const branch = (await ts_results_es_1.Result.wrapAsync(() => api.Branches.create(projectId, makeDatedBranchName("chore/security-audit"), mainBranch))).mapErr((e) => {
|
|
304
|
+
console.log(e);
|
|
305
|
+
return "could not create branch";
|
|
539
306
|
});
|
|
307
|
+
if (branch.isErr())
|
|
308
|
+
return branch;
|
|
309
|
+
const commit = (await ts_results_es_1.Result.wrapAsync(() => api.Commits.create(projectId, branch.value.name, "chore(security): add empty security audit document template", [
|
|
310
|
+
{
|
|
311
|
+
action: "create",
|
|
312
|
+
filePath: exports.SECURITY_AUDIT_FILE_NAME,
|
|
313
|
+
content: auditTemplate.value,
|
|
314
|
+
encoding: "text",
|
|
315
|
+
},
|
|
316
|
+
]))).mapErr(() => "could not create commit");
|
|
317
|
+
if (commit.isErr())
|
|
318
|
+
return commit;
|
|
319
|
+
const mr = (await ts_results_es_1.Result.wrapAsync(() => api.MergeRequests.create(projectId, branch.value.name, mainBranch, MR_TITLE, {
|
|
320
|
+
description: `Please follow and update security audit document in \`${exports.SECURITY_AUDIT_FILE_NAME}\`.`,
|
|
321
|
+
assigneeId: userId,
|
|
322
|
+
squash: true,
|
|
323
|
+
labels: "security-audit",
|
|
324
|
+
removeSourceBranch: true,
|
|
325
|
+
}))).mapErr(() => "could not create merge request");
|
|
326
|
+
return mr;
|
|
540
327
|
}
|
|
541
328
|
exports.createSecurityAuditMergeRequest = createSecurityAuditMergeRequest;
|
|
542
329
|
//# sourceMappingURL=createSecurityAuditMergeRequest.js.map
|
|
@@ -544,82 +331,34 @@ exports.createSecurityAuditMergeRequest = createSecurityAuditMergeRequest;
|
|
|
544
331
|
/***/ }),
|
|
545
332
|
|
|
546
333
|
/***/ 6725:
|
|
547
|
-
/***/ (
|
|
334
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
548
335
|
|
|
549
336
|
"use strict";
|
|
550
337
|
|
|
551
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
552
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
553
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
554
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
555
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
556
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
557
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
558
|
-
});
|
|
559
|
-
};
|
|
560
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
561
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
562
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
563
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
564
|
-
function step(op) {
|
|
565
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
566
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
567
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
568
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
569
|
-
switch (op[0]) {
|
|
570
|
-
case 0: case 1: t = op; break;
|
|
571
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
572
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
573
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
574
|
-
default:
|
|
575
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
576
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
577
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
578
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
579
|
-
if (t[2]) _.ops.pop();
|
|
580
|
-
_.trys.pop(); continue;
|
|
581
|
-
}
|
|
582
|
-
op = body.call(thisArg, _);
|
|
583
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
584
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
585
|
-
}
|
|
586
|
-
};
|
|
587
338
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
588
339
|
exports.makeSecurityAuditOverview = exports.evaluateSecurityAudit = void 0;
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
function evaluateSecurityAudit(
|
|
595
|
-
return
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
var filePath, docData, doc;
|
|
602
|
-
return __generator(this, function (_a) {
|
|
603
|
-
switch (_a.label) {
|
|
604
|
-
case 0:
|
|
605
|
-
filePath = (0, path_1.join)(path, createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME);
|
|
606
|
-
return [4 /*yield*/, (0, promises_1.readFile)(filePath)];
|
|
607
|
-
case 1:
|
|
608
|
-
docData = _a.sent();
|
|
609
|
-
doc = docData.toString("utf-8");
|
|
610
|
-
return [2 /*return*/, (0, auditDocument_1.evaluateDocument)(doc)];
|
|
611
|
-
}
|
|
612
|
-
});
|
|
613
|
-
}); })];
|
|
614
|
-
case 1: return [2 /*return*/, (_c.sent()).mapErr(function (e) { return "could not evaluate ".concat(createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME, ": ").concat(e); })];
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
});
|
|
340
|
+
const ts_results_es_1 = __nccwpck_require__(2807);
|
|
341
|
+
const path_1 = __nccwpck_require__(1017);
|
|
342
|
+
const promises_1 = __nccwpck_require__(3292);
|
|
343
|
+
const createSecurityAuditMergeRequest_1 = __nccwpck_require__(8933);
|
|
344
|
+
const auditDocument_1 = __nccwpck_require__(2488);
|
|
345
|
+
async function evaluateSecurityAudit({ path }) {
|
|
346
|
+
return (await ts_results_es_1.Result.wrapAsync(async () => {
|
|
347
|
+
const filePath = (0, path_1.join)(path, createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME);
|
|
348
|
+
const docData = await (0, promises_1.readFile)(filePath);
|
|
349
|
+
const doc = docData.toString("utf-8");
|
|
350
|
+
return (0, auditDocument_1.evaluateDocument)(doc);
|
|
351
|
+
})).mapErr((e) => `could not evaluate ${createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME}: ${e}`);
|
|
618
352
|
}
|
|
619
353
|
exports.evaluateSecurityAudit = evaluateSecurityAudit;
|
|
620
354
|
function makeSecurityAuditOverview(evaluation) {
|
|
621
|
-
|
|
622
|
-
return
|
|
355
|
+
const ratingToEmo = (r) => (r < 33 ? "🟥" : r < 66 ? "🟨" : "🟩");
|
|
356
|
+
return `Project security posture overview:
|
|
357
|
+
🧐 Total topics: ${evaluation.score.totalTopics}
|
|
358
|
+
🔒 Secured topics: ${evaluation.score.securedTopics}
|
|
359
|
+
📢 Answered topics: ${evaluation.score.answeredTopics}
|
|
360
|
+
❔ Unknown topics: ${evaluation.score.unknownTopics}
|
|
361
|
+
📊 Rating: ${ratingToEmo(evaluation.score.rating)} ${evaluation.score.rating}/100`;
|
|
623
362
|
}
|
|
624
363
|
exports.makeSecurityAuditOverview = makeSecurityAuditOverview;
|
|
625
364
|
//# sourceMappingURL=evaluateSecurityAudit.js.map
|
|
@@ -637,9 +376,9 @@ exports.makeSecurityAuditOverview = makeSecurityAuditOverview;
|
|
|
637
376
|
// this will point to the root package.json
|
|
638
377
|
var _a;
|
|
639
378
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
640
|
-
|
|
379
|
+
const path = ((_a = require.main) === null || _a === void 0 ? void 0 : _a.path) + "/../package.json";
|
|
641
380
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
642
|
-
|
|
381
|
+
const ownPkg = require(path);
|
|
643
382
|
exports["default"] = ownPkg;
|
|
644
383
|
//# sourceMappingURL=packageInfos.js.map
|
|
645
384
|
|
|
@@ -72012,7 +71751,7 @@ var __webpack_exports__ = {};
|
|
|
72012
71751
|
var exports = __webpack_exports__;
|
|
72013
71752
|
|
|
72014
71753
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
72015
|
-
|
|
71754
|
+
const catci_1 = __nccwpck_require__(1123);
|
|
72016
71755
|
(0, catci_1.runCatCi)();
|
|
72017
71756
|
//# sourceMappingURL=catci.js.map
|
|
72018
71757
|
})();
|