From 4258c0cf20ddb17b8495b7c85fb5c46d067a6e7e Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Thu, 9 May 2024 16:40:16 +0100 Subject: [PATCH 1/2] fix: remove auth headers from bare clone of upstream repository @msagi --- .../processors/push-action/pullRemote.js | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/proxy/processors/push-action/pullRemote.js b/src/proxy/processors/push-action/pullRemote.js index a851044e..7d31edf7 100644 --- a/src/proxy/processors/push-action/pullRemote.js +++ b/src/proxy/processors/push-action/pullRemote.js @@ -21,26 +21,9 @@ const exec = async (req, action) => { const cmd = `git clone ${action.url} --bare`; - // Retrieve authorization headers - const authorizationHeader = req.headers?.authorization; - - // Validate the authorization headers - const authorizationValid = - authorizationHeader && - typeof authorizationHeader === 'string' && - authorizationHeader.includes('Basic '); - - // Construct clone URL depending on presence of authorization headers - const cloneUrl = authorizationValid - ? `https://${Buffer.from(authorizationHeader.split(' ')[1], 'base64')}@${action.url.replace( - /https*:\/\//, - '', - )}` - : action.url; - - step.log(`Exectuting ${cmd}${authorizationValid ? ' with credentials' : ''}`); - - const response = spawnSync('git', ['clone', cloneUrl, '--bare', '--progress'], { + step.log(`Exectuting ${cmd}`); + + const response = spawnSync('git', ['clone', action.url, '--bare', '--progress'], { cwd: action.proxyGitPath, encoding: 'utf-8', }); From 5ec4ebc970f4189943e9176cdfd45ff6aee410cd Mon Sep 17 00:00:00 2001 From: Jamie Slome Date: Thu, 9 May 2024 16:47:14 +0100 Subject: [PATCH 2/2] chore: prepare release of version 1.2.1 --- package.json | 2 +- website/docs/installation.mdx | 2 +- website/docusaurus.config.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 93d31c9b..8e8c4b8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@finos/git-proxy", - "version": "1.2.0", + "version": "1.2.1", "description": "Deploy custom push protections and policies on top of Git.", "scripts": { "cli": "node ./packages/git-proxy-cli/index.js", diff --git a/website/docs/installation.mdx b/website/docs/installation.mdx index 600fdbce..4d807dec 100644 --- a/website/docs/installation.mdx +++ b/website/docs/installation.mdx @@ -22,7 +22,7 @@ npm install -g @finos/git-proxy-cli To install a specific version of Git Proxy, append the version to the end of the install command: ```bash -npm install -g @finos/git-proxy@1.2.0 +npm install -g @finos/git-proxy@1.2.1 ``` To install a specific version of the Git Proxy CLI, append the version to the end of the install command: diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index a82e3239..12e82c06 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -11,7 +11,7 @@ module.exports = { projectName: `${projectName}`, organizationName: 'FINOS', customFields: { - version: '1.2.0', + version: '1.2.1', }, scripts: ['https://buttons.github.io/buttons.js'], stylesheets: ['https://fonts.googleapis.com/css?family=Overpass:400,400i,700'],