Candidate-zone CNAMEs and Unbound local names for dex./head. under domain2, the public-record helper and Dex LDAP env test, plus the matching docs. This work predates this session and went live with the 2026-09-14 switch on pinix. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JGodmgtRqahbT52gApsM8N
17 lines
899 B
Bash
17 lines
899 B
Bash
#!/usr/bin/env bash
|
|
# Run as root on a systemd host; uses only synthetic credentials.
|
|
set -euo pipefail
|
|
test_dir=$(mktemp -d /tmp/dex-ldap-env-test.XXXXXX)
|
|
trap 'rm -f "$test_dir/password" "$test_dir/environment" "$test_dir/actual"; rmdir "$test_dir"' EXIT
|
|
script_dir=$(cd -- "$(dirname -- "$0")" && pwd)
|
|
|
|
for password in 'simple' ' spaces "quotes" \slash $dollar `backtick` #hash ;semi ' $'line one\nline two'; do
|
|
printf '%s' "$password" > "$test_dir/password"
|
|
bash "$script_dir/dex-ldap-env.sh" "$test_dir/password" "$test_dir/environment"
|
|
test "$(stat -c %a "$test_dir/environment")" = 600
|
|
systemd-run --quiet --wait --pipe --collect \
|
|
--property="EnvironmentFile=$test_dir/environment" \
|
|
"$(command -v bash)" -c 'printf "%s" "$LDAP_BIND_PW"' > "$test_dir/actual"
|
|
cmp "$test_dir/password" "$test_dir/actual"
|
|
done
|
|
printf 'Dex LDAP EnvironmentFile round-trip: 3 cases passed\n'
|