mirror of
https://github.com/NohamR/LetCTF.git
synced 2026-05-24 19:59:20 +00:00
18 lines
448 B
Python
18 lines
448 B
Python
import json
|
|
from typing import Dict
|
|
from pathlib import Path
|
|
|
|
def load_config(file_path: str | Path) -> Dict:
|
|
"""Load configuration from a JSON file
|
|
Expected format:
|
|
{
|
|
"token": "your_token",
|
|
"provider": "provider_name"
|
|
}
|
|
"""
|
|
path = Path(file_path)
|
|
if not path.exists():
|
|
raise FileNotFoundError(f"Config file not found: {file_path}")
|
|
|
|
with open(path, 'r') as f:
|
|
return json.load(f) |