Publish curated Unraid-AppOps-Gateway source from 034c9f844d2455850ba37b31379b7edaa786583e
This commit is contained in:
1 parent
c61fbfd87f
commit
1a54836efc
101 files changed
+4973
-1298
No files matched your search
@@ -0,0 +1,20 @@
|
||||
"""Existing feature tests run as a signed-in admin; identity tests use real auth.
|
||||
|
||||
This is a test-only principal, never a runtime authentication bypass. The auth,
|
||||
proxy, OIDC and machine-boundary suites exercise real middleware separately.
|
||||
"""
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def authenticated_feature_tests(request, monkeypatch):
|
||||
# Load route modules before patching. Otherwise their direct imports can
|
||||
# retain this test principal after monkeypatch restores the service module.
|
||||
from backend.app import main as app_main
|
||||
app_main._MUTATION_WINDOWS.clear()
|
||||
if request.path.name in {"test_user_auth.py", "test_oidc_login.py", "test_security_boundaries.py", "test_mcp_rag_n8n_integrations.py"}:
|
||||
return
|
||||
from backend.app.db.models import GatewayUser
|
||||
from backend.app.services import user_access
|
||||
principal = GatewayUser(id=f"feature-test:{request.node.nodeid}", provider="authentik", issuer="test", subject="feature-test-admin", role="admin")
|
||||
monkeypatch.setattr(user_access, "current_user", lambda _request: principal)
|
||||
Reference in new issue
Block a user