Skip to content

Commit 44720ca

Browse files
find . -type f -exec sed -i 's/GITHUB_PERSONAL_ACCESS_TOKEN/GH_TOKEN/g' {} \;
1 parent 085f13e commit 44720ca

File tree

12 files changed

+21
-21
lines changed

12 files changed

+21
-21
lines changed

.devcontainer/post-attach.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ if [ -v CODESPACES ]; then
77
if [ ! -v AI_API_TOKEN ]; then
88
echo "⚠️ Running in Codespaces - please add AI_API_TOKEN to your Codespaces secrets"
99
fi
10-
if [ ! -v GITHUB_PERSONAL_ACCESS_TOKEN ]; then
11-
echo "⚠️ Running in Codespaces - please add GITHUB_PERSONAL_ACCESS_TOKEN to your Codespaces secrets"
10+
if [ ! -v GH_TOKEN ]; then
11+
echo "⚠️ Running in Codespaces - please add GH_TOKEN to your Codespaces secrets"
1212
fi
1313
fi
1414

src/run_seclab_agent.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ mkdir -p data
1010

1111
docker run -i \
1212
--mount type=bind,src="$PWD",dst=/app \
13-
-e GITHUB_PERSONAL_ACCESS_TOKEN="$GITHUB_PERSONAL_ACCESS_TOKEN" -e AI_API_TOKEN="$AI_API_TOKEN" "ghcr.io/githubsecuritylab/seclab-taskflow-agent" "$@"
13+
-e GH_TOKEN="$GH_TOKEN" -e AI_API_TOKEN="$AI_API_TOKEN" "ghcr.io/githubsecuritylab/seclab-taskflow-agent" "$@"

src/seclab_taskflows/mcp_servers/codeql_python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CODEQL_DBS_BASE_PATH="/workspaces/seclab-taskflows/data/codeql_databases" # path
2323
# Example values for a local setup, run with `python -m seclab_taskflow_agent -t seclab_taskflows.taskflows.audit.remote_sources_local`
2424
MEMCACHE_STATE_DIR="/workspaces/seclab-taskflows/data" # path to folder for storing the memcache database
2525
DATA_DIR="/workspaces/seclab-taskflows/data" # path to folder for storing the codeql_sqlite databases and all other data
26-
GITHUB_PERSONAL_ACCESS_TOKEN= # can be the same token as COPILOT_TOKEN. Or another one, with access e.g. to private repositories
26+
GH_TOKEN= # can be the same token as COPILOT_TOKEN. Or another one, with access e.g. to private repositories
2727
CODEQL_CLI= # output of command `find ~ -type f -name codeql -executable 2>/dev/null`
2828
2929
# Example docker env run with ./run_seclab_agent.sh [...]

src/seclab_taskflows/mcp_servers/gh_actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __repr__(self):
4545

4646
unimportant_triggers = set(['pull_request', 'workflow_dispatch'])
4747

48-
GITHUB_PERSONAL_ACCESS_TOKEN = os.getenv('GITHUB_PERSONAL_ACCESS_TOKEN', default='')
48+
GH_TOKEN = os.getenv('GH_TOKEN', default='')
4949

5050
ACTIONS_DB_DIR = mcp_data_dir('seclab-taskflows', 'gh_actions', 'ACTIONS_DB_DIR')
5151

@@ -56,7 +56,7 @@ def __repr__(self):
5656
async def call_api(url: str, params: dict, raw = False) -> str:
5757
"""Call the GitHub code scanning API to fetch alert."""
5858
headers = {"Accept": "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28",
59-
"Authorization": f"Bearer {GITHUB_PERSONAL_ACCESS_TOKEN}"}
59+
"Authorization": f"Bearer {GH_TOKEN}"}
6060
if raw:
6161
headers["Accept"] = "application/vnd.github.raw+json"
6262
async def _fetch(url, headers, params):

src/seclab_taskflows/mcp_servers/gh_code_scanning.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
mcp = FastMCP("GitHubCodeScanning")
2929

30-
GITHUB_PERSONAL_ACCESS_TOKEN = os.getenv('GITHUB_PERSONAL_ACCESS_TOKEN', default='')
30+
GH_TOKEN = os.getenv('GH_TOKEN', default='')
3131

3232
CODEQL_DBS_BASE_PATH = mcp_data_dir('seclab-taskflows', 'codeql', 'CODEQL_DBS_BASE_PATH')
3333
ALERT_RESULTS_DIR = mcp_data_dir('seclab-taskflows', 'gh_code_scanning', 'ALERT_RESULTS_DIR')
@@ -72,7 +72,7 @@ def _get_repo_from_html_url(html_url: str) -> str:
7272
async def call_api(url: str, params: dict) -> str | httpx.Response:
7373
"""Call the GitHub code scanning API to fetch alert."""
7474
headers = {"Accept": "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28",
75-
"Authorization": f"Bearer {GITHUB_PERSONAL_ACCESS_TOKEN}"}
75+
"Authorization": f"Bearer {GH_TOKEN}"}
7676
async def _fetch_alerts(url, headers, params):
7777
try:
7878
async with httpx.AsyncClient(headers = headers) as client:
@@ -182,7 +182,7 @@ async def _fetch_codeql_databases(owner: str, repo: str, language: str):
182182
"""Fetch the CodeQL databases for a given repo and language."""
183183
url = f"https://api.github.com/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}"
184184
headers = {"Accept": "application/zip,application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28",
185-
"Authorization": f"Bearer {os.getenv('GITHUB_PERSONAL_ACCESS_TOKEN')}"}
185+
"Authorization": f"Bearer {os.getenv('GH_TOKEN')}"}
186186
try:
187187
async with httpx.AsyncClient() as client:
188188
async with client.stream('GET', url, headers =headers, follow_redirects=True) as response:
@@ -238,7 +238,7 @@ async def dismiss_alert(
238238
headers = {
239239
"Accept": "application/vnd.github+json",
240240
"X-GitHub-Api-Version": "2022-11-28",
241-
"Authorization": f"Bearer {GITHUB_PERSONAL_ACCESS_TOKEN}"
241+
"Authorization": f"Bearer {GH_TOKEN}"
242242
}
243243

244244
async with httpx.AsyncClient(headers=headers) as client:

src/seclab_taskflows/mcp_servers/gh_file_viewer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __repr__(self):
4343

4444
mcp = FastMCP("GitHubFileViewer")
4545

46-
GITHUB_PERSONAL_ACCESS_TOKEN = os.getenv('GITHUB_PERSONAL_ACCESS_TOKEN', default='')
46+
GH_TOKEN = os.getenv('GH_TOKEN', default='')
4747

4848
SEARCH_RESULT_DIR = mcp_data_dir('seclab-taskflows', 'gh_file_viewer', 'SEARCH_RESULTS_DIR')
4949

@@ -54,7 +54,7 @@ def __repr__(self):
5454
async def call_api(url: str, params: dict) -> str:
5555
"""Call the GitHub code scanning API to fetch alert."""
5656
headers = {"Accept": "application/vnd.github.raw+json", "X-GitHub-Api-Version": "2022-11-28",
57-
"Authorization": f"Bearer {GITHUB_PERSONAL_ACCESS_TOKEN}"}
57+
"Authorization": f"Bearer {GH_TOKEN}"}
5858
async def _fetch_file(url, headers, params):
5959
try:
6060
async with httpx.AsyncClient(headers = headers) as client:
@@ -79,7 +79,7 @@ async def _fetch_source_zip(owner: str, repo: str, tmp_dir):
7979
"""Fetch the source code."""
8080
url = f"https://api.github.com/repos/{owner}/{repo}/zipball"
8181
headers = {"Accept": "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28",
82-
"Authorization": f"Bearer {GITHUB_PERSONAL_ACCESS_TOKEN}"}
82+
"Authorization": f"Bearer {GH_TOKEN}"}
8383
try:
8484
async with httpx.AsyncClient() as client:
8585
async with client.stream('GET', url, headers =headers, follow_redirects=True) as response:

src/seclab_taskflows/mcp_servers/local_gh_resources.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
mcp = FastMCP("LocalGHResources")
2424

25-
GITHUB_PERSONAL_ACCESS_TOKEN = os.getenv('GITHUB_PERSONAL_ACCESS_TOKEN')
25+
GH_TOKEN = os.getenv('GH_TOKEN')
2626

2727
LOCAL_GH_DIR = mcp_data_dir('seclab-taskflows', 'local_gh_resources', 'LOCAL_GH_DIR')
2828

@@ -45,7 +45,7 @@ def sanitize_file_path(file_path, allow_paths):
4545
async def call_api(url: str, params: dict) -> str:
4646
"""Call the GitHub code scanning API to fetch alert."""
4747
headers = {"Accept": "application/vnd.github.raw+json", "X-GitHub-Api-Version": "2022-11-28",
48-
"Authorization": f"Bearer {GITHUB_PERSONAL_ACCESS_TOKEN}"}
48+
"Authorization": f"Bearer {GH_TOKEN}"}
4949
async def _fetch_file(url, headers, params):
5050
try:
5151
async with httpx.AsyncClient(headers = headers) as client:
@@ -67,7 +67,7 @@ async def _fetch_source_zip(owner: str, repo: str, tmp_dir):
6767
"""Fetch the source code."""
6868
url = f"https://api.github.com/repos/{owner}/{repo}/zipball"
6969
headers = {"Accept": "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28",
70-
"Authorization": f"Bearer {GITHUB_PERSONAL_ACCESS_TOKEN}"}
70+
"Authorization": f"Bearer {GH_TOKEN}"}
7171
try:
7272
async with httpx.AsyncClient() as client:
7373
async with client.stream('GET', url, headers =headers, follow_redirects=True) as response:

src/seclab_taskflows/toolboxes/gh_actions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ server_params:
1010
command: python
1111
args: ["-m", "seclab_taskflows.mcp_servers.gh_actions"]
1212
env:
13-
GITHUB_PERSONAL_ACCESS_TOKEN: "{{ env GITHUB_PERSONAL_ACCESS_TOKEN }}"
13+
GH_TOKEN: "{{ env GH_TOKEN }}"
1414
ACTIONS_DB_DIR: "{{ env DATA_DIR }}"

src/seclab_taskflows/toolboxes/gh_code_scanning.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ server_params:
1010
command: python
1111
args: ["-m", "seclab_taskflows.mcp_servers.gh_code_scanning"]
1212
env:
13-
GITHUB_PERSONAL_ACCESS_TOKEN: "{{ env GITHUB_PERSONAL_ACCESS_TOKEN }}"
13+
GH_TOKEN: "{{ env GH_TOKEN }}"
1414
CODEQL_DBS_BASE_PATH: "{{ env CODEQL_DBS_BASE_PATH }}"
1515
ALERT_RESULTS_DIR: "{{ env DATA_DIR }}"

src/seclab_taskflows/toolboxes/gh_file_viewer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ server_params:
1010
command: python
1111
args: ["-m", "seclab_taskflows.mcp_servers.gh_file_viewer"]
1212
env:
13-
GITHUB_PERSONAL_ACCESS_TOKEN: "{{ env GITHUB_PERSONAL_ACCESS_TOKEN }}"
13+
GH_TOKEN: "{{ env GH_TOKEN }}"
1414
SEARCH_RESULTS_DIR: "{{ env DATA_DIR }}"

0 commit comments

Comments
 (0)