You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All pushes that flow through Git Proxy require an approval (authorisation). Until a push is approved, Git Proxy will block the commits from being sent to the upstream repository. To approve a push, you can use the REST API or web UI.
7
+
8
+
## Using the REST API
9
+
10
+
### Prerequisites
11
+
12
+
- Proxy and REST API are running ([default behaviour](https://github.com/finos/git-proxy/blob/main/index.js))
13
+
- Proxy and REST API are running on `localhost:8000` and `localhost:8080`, respectively
14
+
-[Intercepting a push](/docs/quickstart/intercept) instructions have been followed and you've reached [Push via Git Proxy](/docs/quickstart/intercept#push-via-git-proxy)
15
+
-[`curl`](https://curl.se/) is installed
16
+
17
+
### Instructions
18
+
19
+
#### 1. Find the tracking `ID`
20
+
21
+
Following on from [Push via Git Proxy](/docs/quickstart/intercept#push-via-git-proxy), you'll receive a unique URL:
Use the default & auto-generated Git Proxy username & password credentials to obtain a cookie. The cookie value is saved to a file (`git-proxy-cookie`):
36
+
37
+
```bash
38
+
curl -H "Content-Type: application/json" -c git-proxy-cookie -X POST \
Using the [cookie](/docs/quickstart/approve#2-authenticate-with-the-api) generated, execute a `GET` request to confirm that your push with `ID` exists in the database:
description: Ready to take Git Proxy for a test drive?
2
+
title: Intercepting a push
3
+
description: How to intercept a push with Git Proxy
4
4
---
5
5
6
-
### 1. Create a simple configuration
6
+
In this section, we will demonstrate the power 💪 of Git Proxy and how it works with a barebones & out-of-the-box demonstration using default configuration. Before we start, there are a few prerequisites:
7
7
8
-
Create a configuration file in a workspace with the following JSON:
8
+
### Prerequisites
9
9
10
-
```json title="proxy.config.json"
10
+
#### 1. Fork Git Proxy
11
+
12
+
For demonstration purposes, we recommend forking [Git Proxy](https://github.com/finos/git-proxy/fork) and then cloning the repository to your PC:
Git Proxy sits between the local clone of your repository and its remote upstream. Essentially, instead of communicating directly with the live version of your repository, you configure your local clone to speak with Git Proxy first.
31
-
32
-
For demonstration purposes, we recommend forking [Git Proxy](https://github.com/finos/git-proxy/fork) and cloning the repository to your PC:
42
+
To confirm Git Proxy is running successfully, you should see the following in your terminal:
Navigate into your test-bed repository on your PC:
50
+
### Introduce Git Proxy to your clone
51
+
52
+
Navigate into your test-bed repository (where you cloned your Git Proxy fork) on your PC:
41
53
42
54
```bash
43
55
cd ./git-proxy
@@ -46,7 +58,9 @@ cd ./git-proxy
46
58
By default the clone of your repository will communicate with GitHub. To change this, so that your local copy of the repository speaks with Git Proxy, run:
The push is now held in a suspended state by Git Proxy and requires [approval](/docs/quickstart/approve) before it can be pushed to the upstream repository on GitHub.
98
+
99
+
73
100
#### Managing credentials
74
101
75
102
Git Proxy will prompt the entry of your git credentials. These credentials are your GitHub username and a [Personal Access Token](https://github.com/settings/tokens). For the ability to push and pull code through Git Proxy, you will only require the `public_repo` scope.
@@ -90,17 +117,5 @@ Git Proxy **does not** use your Personal Access Token other than to authenticate
90
117
91
118
:::
92
119
93
-
### 6. Eureka! 🎉
94
-
95
-
Immediately after a push, you should receive a message, like this, in your terminal:
0 commit comments