Skip to content

Commit 5e1e841

Browse files
committed
Fix ruff formatting in env-info endpoint
1 parent 9a2211a commit 5e1e841

1 file changed

Lines changed: 34 additions & 16 deletions

File tree

app/main.py

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,22 +1161,29 @@ async def api_env_info(request: Request) -> list[dict[str, Any]]:
11611161
_require_owner(request)
11621162
env_defs = [
11631163
("CASHPILOT_API_KEY", "Fleet API Key", True, "Bearer token for worker-to-UI authentication"),
1164-
("CASHPILOT_SECRET_KEY", "Session Secret Key", True, "Secret for JWT session tokens — change from default for security"),
1164+
(
1165+
"CASHPILOT_SECRET_KEY",
1166+
"Session Secret Key",
1167+
True,
1168+
"Secret for JWT session tokens — change from default for security",
1169+
),
11651170
("CASHPILOT_DATA_DIR", "Data Directory", False, "Directory containing the SQLite database"),
11661171
("DATABASE_PATH", "Database Path", False, "Full path override for the SQLite database file"),
11671172
("TZ", "System Timezone", False, "Container timezone in IANA format (e.g. Europe/Madrid)"),
11681173
]
11691174
result = []
11701175
for key, label, secret, desc in env_defs:
11711176
raw = os.getenv(key, "")
1172-
result.append({
1173-
"key": key,
1174-
"label": label,
1175-
"secret": secret,
1176-
"description": desc,
1177-
"set_via_env": bool(raw),
1178-
"value": "********" if (secret and raw) else raw,
1179-
})
1177+
result.append(
1178+
{
1179+
"key": key,
1180+
"label": label,
1181+
"secret": secret,
1182+
"description": desc,
1183+
"set_via_env": bool(raw),
1184+
"value": "********" if (secret and raw) else raw,
1185+
}
1186+
)
11801187
return result
11811188

11821189

@@ -1190,7 +1197,16 @@ async def api_collectors_meta(request: Request) -> list[dict[str, Any]]:
11901197
_require_auth_api(request)
11911198
from app.collectors import _COLLECTOR_ARGS, COLLECTOR_MAP
11921199

1193-
secret_args = {"password", "token", "auth_token", "access_token", "api_key", "session_cookie", "oauth_token", "brd_sess_id"}
1200+
secret_args = {
1201+
"password",
1202+
"token",
1203+
"auth_token",
1204+
"access_token",
1205+
"api_key",
1206+
"session_cookie",
1207+
"oauth_token",
1208+
"brd_sess_id",
1209+
}
11941210
meta = []
11951211
for slug in sorted(COLLECTOR_MAP.keys()):
11961212
args = _COLLECTOR_ARGS.get(slug, [])
@@ -1201,12 +1217,14 @@ async def api_collectors_meta(request: Request) -> list[dict[str, Any]]:
12011217
optional = arg.startswith("?")
12021218
arg_name = arg.lstrip("?")
12031219
config_key = f"{slug}_{arg_name}"
1204-
fields.append({
1205-
"key": config_key,
1206-
"label": arg_name.replace("_", " ").title(),
1207-
"secret": arg_name in secret_args,
1208-
"required": not optional,
1209-
})
1220+
fields.append(
1221+
{
1222+
"key": config_key,
1223+
"label": arg_name.replace("_", " ").title(),
1224+
"secret": arg_name in secret_args,
1225+
"required": not optional,
1226+
}
1227+
)
12101228
meta.append({"slug": slug, "name": name, "fields": fields})
12111229
return meta
12121230

0 commit comments

Comments
 (0)