feat: add Gitea API client module with repository management methods
Implement a new gitea_api.py module providing a GiteaApiClient class with methods for creating, listing, and deleting repositories via the Gitea REST API. Includes authentication handling, error response parsing, and pagination support for listing endpoints.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
service.py
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
||||
+2
-2
@@ -167,7 +167,7 @@ class GiteaRepoManager:
|
||||
Returns:
|
||||
List[Dict[str, Any]]: List of user data dictionaries.
|
||||
"""
|
||||
url = f"{self.api_url}/api/v1/admin/users?page={page}&limit={limit}"
|
||||
url = f"{self.api_url}/admin/users?page={page}&limit={limit}"
|
||||
all_users = []
|
||||
|
||||
try:
|
||||
@@ -204,7 +204,7 @@ class GiteaRepoManager:
|
||||
bool: True if deletion was successful, False otherwise.
|
||||
"""
|
||||
purge_param = "?purge=true" if purge else ""
|
||||
url = f"{self.api_url}/api/v1/admin/users/{username}{purge_param}"
|
||||
url = f"{self.api_url}/admin/users/{username}{purge_param}"
|
||||
|
||||
if dry_run:
|
||||
logger.info(f"Would delete user: {username} (purge: {purge})")
|
||||
|
||||
Reference in New Issue
Block a user