@@ -0,0 +1,78 @@
1+---
2+id: contribution
3+title: Contribution Guide
4+---
5+
6+We track bugs and issues using Github.
7+
8+If you find a bug, please open an Issue. When opening an Issue or Pull Request please follow the preconfigured template and take special note of the checkboxes.
9+
10+If you want to fix a bug, add a new feature or extend existing functionality, please create a fork, create a feature branch and open a PR back to this repo.
11+Please mention open bug issue number(s) within your PR if applicable.
12+
13+We suggest using [Visual Studio Code](https://code.visualstudio.com/docs/languages/go) with the official [Go for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=golang.go) extension.
14+
15+
16+# Go version
17+
18+This project is currently still using go 1.19. You can follow the installation guide for go [here.](https://go.dev/doc/install) And you can find go version 1.19 in the archived section [here.](https://go.dev/dl/)
19+
20+# Preparing your fork
21+Clone your fork, create a feature branch and update the depedencies to get started.
22+```bash
23+git clone git@github.com:<YOUR_FORK>/oauth2-proxy
24+cd oauth2-proxy
25+git branch feature/<BRANCH_NAME>
26+git push --set-upstream origin feature/<BRANCH_NAME>
27+go mod download
28+```
29+
30+
31+# Testing / Debugging
32+For starting oauth2-proxy locally open the debugging tab and create the `launch.json` and select `Go: Launch Package`.
33+
34+
35+```json
36+{
37+ "version": "0.2.0",
38+ "configurations": [
39+ {
40+ "name": "Launch OAuth2-Proxy with Dex",
41+ "type": "go",
42+ "request": "launch",
43+ "mode": "auto",
44+ "program": "${workspaceFolder}",
45+ "args": [
46+ "--config",
47+ // The following configuration contains settings for a locally deployed
48+ // upstream and dex as an idetity provider
49+ "contrib/local-environment/oauth2-proxy.cfg"
50+ ]
51+ },
52+ {
53+ "name": "Launch OAuth2-Proxy with Keycloak",
54+ "type": "go",
55+ "request": "launch",
56+ "mode": "auto",
57+ "program": "${workspaceFolder}",
58+ "args": [
59+ "--config",
60+ // The following configuration contains settings for a locally deployed
61+ // upstream and keycloak as an idetity provider
62+ "contrib/local-environment/oauth2-proxy-keycloak.cfg"
63+ ]
64+ }
65+ ]
66+}
67+```
68+
69+Before you can start your local version of oauth2-proxy, you will have to use the provided docker compose files to start a local upstream service and identity provider. We suggest using [httpbin](https://hub.docker.com/r/kennethreitz/httpbin) as your upstream for testing as it allows for request and response introspection of all things HTTP.
70+
71+Open a terminal and switch to the `contrib/local-environment` directory.
72+
73+- Dex as your IdP: `docker compose -f docker-compose.yaml up dex etcd httpbin`
74+- Keycloak as your IdP: `docker compose -f docker-compose-keycloak.yaml up keycloak httpbin`
75+
76+The username for both is `admin@example.com` and password is `password`.
77+
78+Start oauth2-proxy from the debug tab and open http://oauth2-proxy.localtest.me:4180/ for testing.