Skip to content

Commit 6ddc713

Browse files
authored
Merge pull request #549 from finos/fix/remove-auth-header-on-clone
Remove auth headers from bare git clone on server
2 parents 6e4141b + b27bb3b commit 6ddc713

File tree

4 files changed

+6
-23
lines changed

4 files changed

+6
-23
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@finos/git-proxy",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Deploy custom push protections and policies on top of Git.",
55
"scripts": {
66
"cli": "node ./packages/git-proxy-cli/index.js",

src/proxy/processors/push-action/pullRemote.js

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,9 @@ const exec = async (req, action) => {
2121

2222
const cmd = `git clone ${action.url} --bare`;
2323

24-
// Retrieve authorization headers
25-
const authorizationHeader = req.headers?.authorization;
26-
27-
// Validate the authorization headers
28-
const authorizationValid =
29-
authorizationHeader &&
30-
typeof authorizationHeader === 'string' &&
31-
authorizationHeader.includes('Basic ');
32-
33-
// Construct clone URL depending on presence of authorization headers
34-
const cloneUrl = authorizationValid
35-
? `https://${Buffer.from(authorizationHeader.split(' ')[1], 'base64')}@${action.url.replace(
36-
/https*:\/\//,
37-
'',
38-
)}`
39-
: action.url;
40-
41-
step.log(`Exectuting ${cmd}${authorizationValid ? ' with credentials' : ''}`);
42-
43-
const response = spawnSync('git', ['clone', cloneUrl, '--bare', '--progress'], {
24+
step.log(`Exectuting ${cmd}`);
25+
26+
const response = spawnSync('git', ['clone', action.url, '--bare', '--progress'], {
4427
cwd: action.proxyGitPath,
4528
encoding: 'utf-8',
4629
});

website/docs/installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ npm install -g @finos/git-proxy-cli
2222
To install a specific version of Git Proxy, append the version to the end of the install command:
2323

2424
```bash
25-
npm install -g @finos/[email protected].0
25+
npm install -g @finos/[email protected].1
2626
```
2727

2828
To install a specific version of the Git Proxy CLI, append the version to the end of the install command:

website/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module.exports = {
1111
projectName: `${projectName}`,
1212
organizationName: 'FINOS',
1313
customFields: {
14-
version: '1.2.0',
14+
version: '1.2.1',
1515
},
1616
scripts: ['https://buttons.github.io/buttons.js'],
1717
stylesheets: ['https://fonts.googleapis.com/css?family=Overpass:400,400i,700'],

0 commit comments

Comments
 (0)