fix(jira): expose non-admin jira-config, drop security-test label; catalog paging

GET /system/jira-config was admin-only, so non-admin users hit a 403
and the frontend silently fell back to a hardcoded jira.atlassian.com
base URL when building /browse/{key} links. Opened it to any
authenticated user (still no secrets returned).

Also drops the redundant 'security-test' Jira label, and adds a
page-size selector (10/25/50/100) and a 'no existing test yet' filter
to the Test Catalog.
This commit is contained in:
kitos
2026-07-10 10:24:13 +02:00
parent 2afb886cd9
commit f32f636f05
5 changed files with 77 additions and 17 deletions
+5 -3
View File
@@ -17,7 +17,7 @@ from pydantic import BaseModel
from sqlalchemy.orm import Session
from app.database import SessionLocal, get_db
from app.dependencies.auth import require_role
from app.dependencies.auth import require_role, get_current_user
from app.models.user import User
from app.services.mitre_sync_service import sync_mitre
from app.services.intel_service import scan_intel
@@ -285,11 +285,13 @@ _JIRA_KEYS = {
@router.get("/jira-config", response_model=JiraConfigOut)
def get_jira_config(
db: Session = Depends(get_db),
current_user: User = Depends(require_role("admin")),
current_user: User = Depends(get_current_user),
):
"""Return current Jira configuration (merged DB + env).
**Requires** the ``admin`` role. Credential values are never returned.
Open to any authenticated user — the frontend needs ``url`` to build
correct ``/browse/{key}`` links for non-admin users too. Credential
values (tokens, admin email) are never returned, only booleans.
"""
from app.services.jira_service import (
get_jira_url, get_jira_project_key, is_jira_enabled,