Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ repos:
- id: check-added-large-files
- id: check-merge-conflict
- id: mixed-line-ending
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
324 changes: 324 additions & 0 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
{
"version": "1.5.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
},
{
"name": "AWSKeyDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
},
{
"name": "CloudantDetector"
},
{
"name": "DiscordBotTokenDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"name": "GitLabTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3.0
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "IPPublicDetector"
},
{
"name": "JwtTokenDetector"
},
{
"name": "KeywordDetector",
"keyword_exclude": ""
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "OpenAIDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "PypiTokenDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TelegramBotTokenDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_baseline_file",
"filename": ".secrets.baseline"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
}
],
"results": {
"goose/templates/goose.env": [
{
"type": "Secret Keyword",
"filename": "goose/templates/goose.env",
"hashed_secret": "67343f0f7d53428a66c6664e5e671e09754688f2",
"is_verified": false,
"line_number": 2
}
],
"goose/templates/mcp-atlassian.env": [
{
"type": "Basic Auth Credentials",
"filename": "goose/templates/mcp-atlassian.env",
"hashed_secret": "9d4e1e23bd5b727046a9e3b4b7db57bd8d6ee684",
"is_verified": false,
"line_number": 105
}
],
"mcp_server/tests/unit/test_distgit_tools.py": [
{
"type": "Hex High Entropy String",
"filename": "mcp_server/tests/unit/test_distgit_tools.py",
"hashed_secret": "d4fbef92af33c1789d9130384a56737d181cc6df",
"is_verified": false,
"line_number": 22
}
],
"mcp_server/tests/unit/test_gateway.py": [
{
"type": "GitLab Token",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "f68bd4ab942f012db29f09bbcc991e17768aaafa",
"is_verified": false,
"line_number": 12
},
{
"type": "Base64 High Entropy String",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "db33a8c712a01e26f3209fda54abe878e40d574f",
"is_verified": false,
"line_number": 28
},
{
"type": "Basic Auth Credentials",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "b015d7de724f9aaf5b147f4076a59d41d032f4e3",
"is_verified": false,
"line_number": 35
},
{
"type": "Base64 High Entropy String",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "337dcdf7061ca519f39de8dd4f606f5737f746c9",
"is_verified": false,
"line_number": 44
},
{
"type": "Secret Keyword",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "d2f474a79c11ab6b0f222860701c9cb95a809cf9",
"is_verified": false,
"line_number": 46
},
{
"type": "Base64 High Entropy String",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "d8c2d22cd8f05317aa6300a3bfbc35a1fe3eabb0",
"is_verified": false,
"line_number": 71
},
{
"type": "Base64 High Entropy String",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "8398e9e58a137e35845548126743f3e7bb1b3045",
"is_verified": false,
"line_number": 72
},
{
"type": "Base64 High Entropy String",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "d1af3d84986acb596032080abf01216893ccd65e",
"is_verified": false,
"line_number": 73
},
{
"type": "Base64 High Entropy String",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "9f771c6ac6b7404172b5f961b8fc7c202bebf1e2",
"is_verified": false,
"line_number": 74
},
{
"type": "Basic Auth Credentials",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "923100d19a2d3c043764179cee83d6667696cf19",
"is_verified": false,
"line_number": 109
},
{
"type": "Base64 High Entropy String",
"filename": "mcp_server/tests/unit/test_gateway.py",
"hashed_secret": "4aadfe8a2cfc564a0ebb79d694b73abfb28e1c17",
"is_verified": false,
"line_number": 132
}
],
"openshift/cronjob-supervisor-collector.yml": [
{
"type": "Secret Keyword",
"filename": "openshift/cronjob-supervisor-collector.yml",
"hashed_secret": "2f19b33175a0177192f368f143936cb1c04a2127",
"is_verified": false,
"line_number": 78
},
{
"type": "Secret Keyword",
"filename": "openshift/cronjob-supervisor-collector.yml",
"hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0",
"is_verified": false,
"line_number": 81
}
],
"openshift/deployment-backport-agent-c10s.yml": [
{
"type": "Secret Keyword",
"filename": "openshift/deployment-backport-agent-c10s.yml",
"hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0",
"is_verified": false,
"line_number": 80
}
],
"openshift/deployment-backport-agent-c9s.yml": [
{
"type": "Secret Keyword",
"filename": "openshift/deployment-backport-agent-c9s.yml",
"hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0",
"is_verified": false,
"line_number": 80
}
],
"openshift/deployment-mcp-gateway.yml": [
{
"type": "Secret Keyword",
"filename": "openshift/deployment-mcp-gateway.yml",
"hashed_secret": "2f19b33175a0177192f368f143936cb1c04a2127",
"is_verified": false,
"line_number": 83
}
],
"openshift/deployment-rebase-agent-c10s.yml": [
{
"type": "Secret Keyword",
"filename": "openshift/deployment-rebase-agent-c10s.yml",
"hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0",
"is_verified": false,
"line_number": 81
}
],
"openshift/deployment-rebase-agent-c9s.yml": [
{
"type": "Secret Keyword",
"filename": "openshift/deployment-rebase-agent-c9s.yml",
"hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0",
"is_verified": false,
"line_number": 81
}
],
"openshift/deployment-supervisor-processor.yml": [
{
"type": "Secret Keyword",
"filename": "openshift/deployment-supervisor-processor.yml",
"hashed_secret": "2f19b33175a0177192f368f143936cb1c04a2127",
"is_verified": false,
"line_number": 73
},
{
"type": "Secret Keyword",
"filename": "openshift/deployment-supervisor-processor.yml",
"hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0",
"is_verified": false,
"line_number": 76
}
],
"openshift/deployment-triage-agent.yml": [
{
"type": "Secret Keyword",
"filename": "openshift/deployment-triage-agent.yml",
"hashed_secret": "e00a4cd07445154f8d1b589ad5b7152fdf7d88d0",
"is_verified": false,
"line_number": 79
}
]
},
"generated_at": "2026-03-31T08:34:08Z"
}
12 changes: 11 additions & 1 deletion agents/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,17 @@ async def mcp_tools(


def set_litellm_debug() -> None:
"""Set litellm to print collosal amount of debug information. This CAN LEAK TOKENS to the logs."""
"""Set litellm to print debug information.

WARNING: This CAN LEAK TOKENS to the logs. It is gated behind the
LITELLM_DEBUG environment variable — only enable it in development.
"""
if not os.getenv("LITELLM_DEBUG"):
logger.warning(
"set_litellm_debug() called but LITELLM_DEBUG env var is not set; "
"ignoring to prevent credential leakage in production."
)
return
# the following two modules call `litellm_debug(False)` on import
# import them explicitly now to ensure our call to `litellm_debug()` is not negated later
import beeai_framework.adapters.litellm.chat
Expand Down
15 changes: 12 additions & 3 deletions mcp_server/distgit_tools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import os
import re
import tempfile
import time
from typing import Annotated
Expand All @@ -15,6 +16,11 @@
SYNC_TIMEOUT = 1 * 60 * 60 # seconds


def _sanitize_url(text: str) -> str:
"""Remove oauth2:{token}@ credentials from URLs in error messages."""
return re.sub(r"oauth2:[^@\s]+@", "oauth2:***@", text)


async def create_zstream_branch(
package: Annotated[str, Field(description="Package name")],
branch: Annotated[str, Field(description="Name of the branch to create")]
Expand All @@ -29,8 +35,11 @@ async def create_zstream_branch(
username = principal.split("@", maxsplit=1)[0]
token = os.environ["GITLAB_TOKEN"]
gitlab_repo_url = f"https://oauth2:{token}@gitlab.com/redhat/rhel/rpms/{package}"
if await asyncio.to_thread(git.cmd.Git().ls_remote, gitlab_repo_url, branch, branches=True):
return f"Z-Stream branch {branch} already exists, no need to create it"
try:
if await asyncio.to_thread(git.cmd.Git().ls_remote, gitlab_repo_url, branch, branches=True):
return f"Z-Stream branch {branch} already exists, no need to create it"
except Exception as e:
raise ToolError(f"Failed to check GitLab remote: {_sanitize_url(str(e))}") from e
try:
with tempfile.TemporaryDirectory() as path:
repo = await asyncio.to_thread(
Expand Down Expand Up @@ -70,4 +79,4 @@ async def create_zstream_branch(
await asyncio.sleep(30)
raise RuntimeError(f"The {branch} branch wasn't synced to GitLab after {SYNC_TIMEOUT} seconds")
except Exception as e:
raise ToolError(f"Failed to create Z-Stream branch: {e}") from e
raise ToolError(f"Failed to create Z-Stream branch: {_sanitize_url(str(e))}") from e
Loading
Loading