Remove token-related logging for security

- Remove token type detection logging
- Remove token age/creation time logging
- Keep only non-sensitive debugging info (repo, branch, request IDs)

While the token value was never logged, it's better to err on the side
of caution and not log any token-related information.
This commit is contained in:
Lina Tawfik
2025-05-23 16:20:31 -07:00
parent cde954dda0
commit b02a95b3f3
2 changed files with 0 additions and 9 deletions

View File

@@ -86,14 +86,6 @@ server.tool(
if (!githubToken) {
throw new Error("GITHUB_TOKEN environment variable is required");
}
// Log token info for debugging
console.error(`[commit_files] Token type: ${githubToken.startsWith('ghs_') ? 'GitHub App' : githubToken.startsWith('ghp_') ? 'PAT' : 'Unknown'}`);
console.error(`[commit_files] Token created at: ${process.env.TOKEN_CREATED_AT || 'unknown'}`);
if (process.env.TOKEN_CREATED_AT) {
const tokenAge = Date.now() - new Date(process.env.TOKEN_CREATED_AT).getTime();
console.error(`[commit_files] Token age: ${(tokenAge/60000).toFixed(1)} minutes`);
}
const processedFiles = files.map((filePath) => {
if (filePath.startsWith("/")) {

View File

@@ -35,7 +35,6 @@ export async function prepareMcpConfig(
REPO_NAME: repo,
BRANCH_NAME: branch,
REPO_DIR: process.env.GITHUB_WORKSPACE || process.cwd(),
TOKEN_CREATED_AT: new Date().toISOString(),
GITHUB_API_URL: process.env.GITHUB_API_URL || "https://api.github.com",
},
},