File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ set -euo pipefail
1111GIT_USERNAME=${GIT_USERNAME:- " coopernetes" }
1212GIT_PASSWORD=${GIT_PASSWORD:- " $( cat ~ /.codeberg-pat) " }
1313GIT_REPO=${GIT_REPO:- " codeberg.org/coopernetes/test-repo-codeberg.git" }
14+ GIT_AUTHOR_NAME=${GIT_AUTHOR_NAME:- " Thomas Cooper" }
15+ GIT_EMAIL=${GIT_EMAIL:- " unregistered@example.com" }
1416PROXY_URL=" http://${GIT_USERNAME} :${GIT_PASSWORD} @localhost:8080/proxy/${GIT_REPO} "
1517TEST_BRANCH=" test/proxy-identity-codeberg-$( date +%s) "
1618REPO_DIR=$( mktemp -d /tmp/proxy-identity-codeberg-XXXX)
@@ -21,11 +23,11 @@ cleanup() {
2123trap cleanup EXIT
2224
2325# Clone directly from Codeberg (proxy would block the clone too for unregistered user)
24- git clone " https://${GIT_USERNAME} :${GIT_PASSWORD} @codeberg.org/coopernetes/test-repo-codeberg.git " " ${REPO_DIR} "
26+ git clone " https://${GIT_USERNAME} :${GIT_PASSWORD} @${GIT_REPO} " " ${REPO_DIR} "
2527cd " ${REPO_DIR} "
2628git checkout -b " ${TEST_BRANCH} "
27- git config user.name " coopernetes "
28- git config user.email " coopernetes@proton.me "
29+ git config user.name " ${GIT_AUTHOR_NAME} "
30+ git config user.email " ${GIT_EMAIL} "
2931git remote set-url origin " ${PROXY_URL} "
3032
3133echo " proxy-identity-codeberg - $( date) " >> test-file.txt
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ set -euo pipefail
1212GIT_USERNAME=${GIT_USERNAME:- " coopernetes" }
1313GIT_PASSWORD=${GIT_PASSWORD:- " $( cat ~ /.gitlab-pat) " }
1414GIT_REPO=${GIT_REPO:- " gitlab.com/coopernetes/test-repo-gitlab.git" }
15+ GIT_AUTHOR_NAME=${GIT_AUTHOR_NAME:- " Thomas Cooper" }
16+ GIT_EMAIL=${GIT_EMAIL:- " unregistered@example.com" }
1517GITPROXY_API_KEY=${GITPROXY_API_KEY:- " foobarbaz" }
1618PROXY_URL=" http://${GIT_USERNAME} :${GIT_PASSWORD} @localhost:8080/proxy/${GIT_REPO} "
1719TEST_BRANCH=" test/proxy-identity-gitlab-$( date +%s) "
@@ -27,8 +29,8 @@ trap cleanup EXIT
2729git clone " ${PROXY_URL} " " ${REPO_DIR} "
2830cd " ${REPO_DIR} "
2931git checkout -b " ${TEST_BRANCH} "
30- git config user.name " Thomas Cooper "
31- git config user.email " coopernetes@proton.me "
32+ git config user.name " ${GIT_AUTHOR_NAME} "
33+ git config user.email " ${GIT_EMAIL} "
3234
3335echo " proxy-identity-gitlab - $( date) " >> test-file.txt
3436git add test-file.txt
Original file line number Diff line number Diff line change 66# With a user store configured, the proxy blocks the push as "not registered".
77#
88# Expected: push fails with "not registered" error, no push record created.
9+ #
10+ # Override GIT_EMAIL / GIT_AUTHOR_NAME when adapting for a different deployment.
911set -euo pipefail
1012
1113GIT_USERNAME=${GIT_USERNAME:- " coopernetes" }
1214GIT_PASSWORD=${GIT_PASSWORD:- " $( cat ~ /.codeberg-pat) " }
1315GIT_REPO=${GIT_REPO:- " codeberg.org/coopernetes/test-repo-codeberg.git" }
16+ GIT_AUTHOR_NAME=${GIT_AUTHOR_NAME:- " Thomas Cooper" }
17+ GIT_EMAIL=${GIT_EMAIL:- " unregistered@example.com" }
1418PUSH_URL=" http://${GIT_USERNAME} :${GIT_PASSWORD} @localhost:8080/push/${GIT_REPO} "
1519TEST_BRANCH=" test/identity-codeberg-$( date +%s) "
1620REPO_DIR=$( mktemp -d /tmp/push-identity-codeberg-XXXX)
@@ -21,11 +25,11 @@ cleanup() {
2125trap cleanup EXIT
2226
2327# Clone using the Codeberg PAT directly (bypassing the proxy) so we have a repo to push from
24- git clone " https://${GIT_USERNAME} :${GIT_PASSWORD} @codeberg.org/coopernetes/test-repo-codeberg.git " " ${REPO_DIR} "
28+ git clone " https://${GIT_USERNAME} :${GIT_PASSWORD} @${GIT_REPO} " " ${REPO_DIR} "
2529cd " ${REPO_DIR} "
2630git checkout -b " ${TEST_BRANCH} "
27- git config user.name " coopernetes "
28- git config user.email " coopernetes@proton.me "
31+ git config user.name " ${GIT_AUTHOR_NAME} "
32+ git config user.email " ${GIT_EMAIL} "
2933git remote set-url origin " ${PUSH_URL} "
3034
3135echo " identity-codeberg - $( date) " >> test-file.txt
Original file line number Diff line number Diff line change 88#
99# Expected: push succeeds (warn mode), resolved_user = admin on push record,
1010# identityVerification step = PASS with sideband warning about email.
11+ #
12+ # Override GIT_EMAIL to use your own unregistered address when adapting for
13+ # a different deployment.
1114set -euo pipefail
1215
1316GIT_USERNAME=${GIT_USERNAME:- " coopernetes" }
1417GIT_PASSWORD=${GIT_PASSWORD:- " $( cat ~ /.gitlab-pat) " }
1518GIT_REPO=${GIT_REPO:- " gitlab.com/coopernetes/test-repo-gitlab.git" }
19+ GIT_AUTHOR_NAME=${GIT_AUTHOR_NAME:- " Thomas Cooper" }
20+ GIT_EMAIL=${GIT_EMAIL:- " unregistered@example.com" }
1621PUSH_URL=" http://${GIT_USERNAME} :${GIT_PASSWORD} @localhost:8080/push/${GIT_REPO} "
1722TEST_BRANCH=" test/identity-gitlab-$( date +%s) "
1823REPO_DIR=$( mktemp -d /tmp/push-identity-gitlab-XXXX)
@@ -28,8 +33,8 @@ git clone "${PUSH_URL}" "${REPO_DIR}"
2833cd " ${REPO_DIR} "
2934git checkout -b " ${TEST_BRANCH} "
3035# Use an email NOT registered to admin — triggers email-level identity warning
31- git config user.name " Thomas Cooper "
32- git config user.email " coopernetes@proton.me "
36+ git config user.name " ${GIT_AUTHOR_NAME} "
37+ git config user.email " ${GIT_EMAIL} "
3338
3439echo " identity-gitlab - $( date) " >> test-file.txt
3540git add test-file.txt
You can’t perform that action at this time.
0 commit comments