filter secrets at logger callback; register basic-auth encoded blob

This commit is contained in:
Luther Monson
2026-05-19 21:23:43 -07:00
parent 3f7bad75ec
commit a3c39576df
3 changed files with 124 additions and 2 deletions

View File

@@ -16,8 +16,9 @@ trait GitHubTokenSetupTrait
// GITHUB_TOKEN support
if (($token = getenv('GITHUB_TOKEN')) !== false && ($user = getenv('GITHUB_USER')) !== false) {
logger()->debug("Using 'GITHUB_TOKEN' with user {$user} for authentication");
spc_add_log_filter([$user, $token]);
return ['Authorization: Basic ' . base64_encode("{$user}:{$token}")];
$encoded = base64_encode("{$user}:{$token}");
spc_add_log_filter([$user, $token, $encoded]);
return ["Authorization: Basic {$encoded}"];
}
if (($token = getenv('GITHUB_TOKEN')) !== false) {
logger()->debug("Using 'GITHUB_TOKEN' for authentication");