Validate URLs in web commands before execution (#2616)

Co-authored-by: Reinier van der Leer <github@pwuts.nl>
This commit is contained in:
Eddie Cohen
2023-04-24 06:33:44 -04:00
committed by GitHub
parent 794a164098
commit 40a75c804c
7 changed files with 120 additions and 82 deletions

View File

@@ -3,6 +3,7 @@ from git.repo import Repo
from autogpt.commands.command import command
from autogpt.config import Config
from autogpt.url_utils.validators import validate_url
CFG = Config()
@@ -14,6 +15,7 @@ CFG = Config()
CFG.github_username and CFG.github_api_key,
"Configure github_username and github_api_key.",
)
@validate_url
def clone_repository(repository_url: str, clone_path: str) -> str:
"""Clone a GitHub repository locally.