Skip to content

Commit 036f516

Browse files
coopernetesclaude
andcommitted
chore: scrub personal email, parameterise GIT_AUTHOR_NAME/GIT_EMAIL/GIT_REPO in test scripts
Replace hardcoded coopernetes@proton.me with GIT_EMAIL env var (default: unregistered@example.com) across all four identity test scripts. GIT_AUTHOR_NAME defaults to "Thomas Cooper" but is overridable. Direct clone URLs in codeberg scripts now use ${GIT_REPO} so the repo is fully configurable via a single env var. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent dc917dd commit 036f516

4 files changed

Lines changed: 23 additions & 10 deletions

File tree

test/proxy-identity-codeberg.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ set -euo pipefail
1111
GIT_USERNAME=${GIT_USERNAME:-"coopernetes"}
1212
GIT_PASSWORD=${GIT_PASSWORD:-"$(cat ~/.codeberg-pat)"}
1313
GIT_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"}
1416
PROXY_URL="http://${GIT_USERNAME}:${GIT_PASSWORD}@localhost:8080/proxy/${GIT_REPO}"
1517
TEST_BRANCH="test/proxy-identity-codeberg-$(date +%s)"
1618
REPO_DIR=$(mktemp -d /tmp/proxy-identity-codeberg-XXXX)
@@ -21,11 +23,11 @@ cleanup() {
2123
trap 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}"
2527
cd "${REPO_DIR}"
2628
git 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}"
2931
git remote set-url origin "${PROXY_URL}"
3032

3133
echo "proxy-identity-codeberg - $(date)" >> test-file.txt

test/proxy-identity-gitlab.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ set -euo pipefail
1212
GIT_USERNAME=${GIT_USERNAME:-"coopernetes"}
1313
GIT_PASSWORD=${GIT_PASSWORD:-"$(cat ~/.gitlab-pat)"}
1414
GIT_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"}
1517
GITPROXY_API_KEY=${GITPROXY_API_KEY:-"foobarbaz"}
1618
PROXY_URL="http://${GIT_USERNAME}:${GIT_PASSWORD}@localhost:8080/proxy/${GIT_REPO}"
1719
TEST_BRANCH="test/proxy-identity-gitlab-$(date +%s)"
@@ -27,8 +29,8 @@ trap cleanup EXIT
2729
git clone "${PROXY_URL}" "${REPO_DIR}"
2830
cd "${REPO_DIR}"
2931
git 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

3335
echo "proxy-identity-gitlab - $(date)" >> test-file.txt
3436
git add test-file.txt

test/push-identity-codeberg.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
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.
911
set -euo pipefail
1012

1113
GIT_USERNAME=${GIT_USERNAME:-"coopernetes"}
1214
GIT_PASSWORD=${GIT_PASSWORD:-"$(cat ~/.codeberg-pat)"}
1315
GIT_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"}
1418
PUSH_URL="http://${GIT_USERNAME}:${GIT_PASSWORD}@localhost:8080/push/${GIT_REPO}"
1519
TEST_BRANCH="test/identity-codeberg-$(date +%s)"
1620
REPO_DIR=$(mktemp -d /tmp/push-identity-codeberg-XXXX)
@@ -21,11 +25,11 @@ cleanup() {
2125
trap 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}"
2529
cd "${REPO_DIR}"
2630
git 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}"
2933
git remote set-url origin "${PUSH_URL}"
3034

3135
echo "identity-codeberg - $(date)" >> test-file.txt

test/push-identity-gitlab.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@
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.
1114
set -euo pipefail
1215

1316
GIT_USERNAME=${GIT_USERNAME:-"coopernetes"}
1417
GIT_PASSWORD=${GIT_PASSWORD:-"$(cat ~/.gitlab-pat)"}
1518
GIT_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"}
1621
PUSH_URL="http://${GIT_USERNAME}:${GIT_PASSWORD}@localhost:8080/push/${GIT_REPO}"
1722
TEST_BRANCH="test/identity-gitlab-$(date +%s)"
1823
REPO_DIR=$(mktemp -d /tmp/push-identity-gitlab-XXXX)
@@ -28,8 +33,8 @@ git clone "${PUSH_URL}" "${REPO_DIR}"
2833
cd "${REPO_DIR}"
2934
git 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

3439
echo "identity-gitlab - $(date)" >> test-file.txt
3540
git add test-file.txt

0 commit comments

Comments
 (0)