From 20d8ce8b0d2e6579c09130e7f1683e611e72d8e7 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 15 Sep 2025 09:52:40 +0200 Subject: [PATCH 1/5] Renamed authentication module sources --- src/{auth => authentication}/README.md | 0 src/{auth => authentication}/__init__.py | 0 src/{auth => authentication}/interface.py | 0 src/{auth => authentication}/jwk_token.py | 0 src/{auth => authentication}/k8s.py | 0 src/{auth => authentication}/noop.py | 0 src/{auth => authentication}/noop_with_token.py | 0 src/{auth => authentication}/utils.py | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename src/{auth => authentication}/README.md (100%) rename src/{auth => authentication}/__init__.py (100%) rename src/{auth => authentication}/interface.py (100%) rename src/{auth => authentication}/jwk_token.py (100%) rename src/{auth => authentication}/k8s.py (100%) rename src/{auth => authentication}/noop.py (100%) rename src/{auth => authentication}/noop_with_token.py (100%) rename src/{auth => authentication}/utils.py (100%) diff --git a/src/auth/README.md b/src/authentication/README.md similarity index 100% rename from src/auth/README.md rename to src/authentication/README.md diff --git a/src/auth/__init__.py b/src/authentication/__init__.py similarity index 100% rename from src/auth/__init__.py rename to src/authentication/__init__.py diff --git a/src/auth/interface.py b/src/authentication/interface.py similarity index 100% rename from src/auth/interface.py rename to src/authentication/interface.py diff --git a/src/auth/jwk_token.py b/src/authentication/jwk_token.py similarity index 100% rename from src/auth/jwk_token.py rename to src/authentication/jwk_token.py diff --git a/src/auth/k8s.py b/src/authentication/k8s.py similarity index 100% rename from src/auth/k8s.py rename to src/authentication/k8s.py diff --git a/src/auth/noop.py b/src/authentication/noop.py similarity index 100% rename from src/auth/noop.py rename to src/authentication/noop.py diff --git a/src/auth/noop_with_token.py b/src/authentication/noop_with_token.py similarity index 100% rename from src/auth/noop_with_token.py rename to src/authentication/noop_with_token.py diff --git a/src/auth/utils.py b/src/authentication/utils.py similarity index 100% rename from src/auth/utils.py rename to src/authentication/utils.py From 3c95055e2d8e223df1bc8ab8e9519c9b09b6614f Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 15 Sep 2025 09:52:59 +0200 Subject: [PATCH 2/5] Renamed authentication module unit tests --- tests/unit/{auth => authentication}/__init__.py | 0 tests/unit/{auth => authentication}/test_auth.py | 0 tests/unit/{auth => authentication}/test_jwk_token.py | 0 tests/unit/{auth => authentication}/test_k8s.py | 0 tests/unit/{auth => authentication}/test_noop.py | 0 tests/unit/{auth => authentication}/test_noop_with_token.py | 0 tests/unit/{auth => authentication}/test_utils.py | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename tests/unit/{auth => authentication}/__init__.py (100%) rename tests/unit/{auth => authentication}/test_auth.py (100%) rename tests/unit/{auth => authentication}/test_jwk_token.py (100%) rename tests/unit/{auth => authentication}/test_k8s.py (100%) rename tests/unit/{auth => authentication}/test_noop.py (100%) rename tests/unit/{auth => authentication}/test_noop_with_token.py (100%) rename tests/unit/{auth => authentication}/test_utils.py (100%) diff --git a/tests/unit/auth/__init__.py b/tests/unit/authentication/__init__.py similarity index 100% rename from tests/unit/auth/__init__.py rename to tests/unit/authentication/__init__.py diff --git a/tests/unit/auth/test_auth.py b/tests/unit/authentication/test_auth.py similarity index 100% rename from tests/unit/auth/test_auth.py rename to tests/unit/authentication/test_auth.py diff --git a/tests/unit/auth/test_jwk_token.py b/tests/unit/authentication/test_jwk_token.py similarity index 100% rename from tests/unit/auth/test_jwk_token.py rename to tests/unit/authentication/test_jwk_token.py diff --git a/tests/unit/auth/test_k8s.py b/tests/unit/authentication/test_k8s.py similarity index 100% rename from tests/unit/auth/test_k8s.py rename to tests/unit/authentication/test_k8s.py diff --git a/tests/unit/auth/test_noop.py b/tests/unit/authentication/test_noop.py similarity index 100% rename from tests/unit/auth/test_noop.py rename to tests/unit/authentication/test_noop.py diff --git a/tests/unit/auth/test_noop_with_token.py b/tests/unit/authentication/test_noop_with_token.py similarity index 100% rename from tests/unit/auth/test_noop_with_token.py rename to tests/unit/authentication/test_noop_with_token.py diff --git a/tests/unit/auth/test_utils.py b/tests/unit/authentication/test_utils.py similarity index 100% rename from tests/unit/auth/test_utils.py rename to tests/unit/authentication/test_utils.py From 74b12da94db29ca9164ade2204a93dce63e7dbc6 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 15 Sep 2025 09:59:14 +0200 Subject: [PATCH 3/5] Updated all imports --- src/app/endpoints/authorized.py | 4 ++-- src/app/endpoints/config.py | 4 ++-- src/app/endpoints/conversations.py | 2 +- src/app/endpoints/feedback.py | 4 ++-- src/app/endpoints/health.py | 4 ++-- src/app/endpoints/info.py | 4 ++-- src/app/endpoints/metrics.py | 4 ++-- src/app/endpoints/models.py | 4 ++-- src/app/endpoints/query.py | 4 ++-- src/app/endpoints/root.py | 4 ++-- src/app/endpoints/streaming_query.py | 4 ++-- src/authentication/__init__.py | 4 ++-- src/authentication/jwk_token.py | 4 ++-- src/authentication/k8s.py | 2 +- src/authentication/noop.py | 2 +- src/authentication/noop_with_token.py | 4 ++-- src/authorization/resolvers.py | 2 +- src/lightspeed_stack.py | 1 + 18 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/app/endpoints/authorized.py b/src/app/endpoints/authorized.py index 6282ccc64..8bf2a2e50 100644 --- a/src/app/endpoints/authorized.py +++ b/src/app/endpoints/authorized.py @@ -5,8 +5,8 @@ from fastapi import APIRouter, Depends -from auth.interface import AuthTuple -from auth import get_auth_dependency +from authentication.interface import AuthTuple +from authentication import get_auth_dependency from models.responses import AuthorizedResponse, UnauthorizedResponse, ForbiddenResponse logger = logging.getLogger(__name__) diff --git a/src/app/endpoints/config.py b/src/app/endpoints/config.py index 93b1b22ea..99c1104d5 100644 --- a/src/app/endpoints/config.py +++ b/src/app/endpoints/config.py @@ -5,8 +5,8 @@ from fastapi import APIRouter, Request, Depends -from auth.interface import AuthTuple -from auth import get_auth_dependency +from authentication.interface import AuthTuple +from authentication import get_auth_dependency from authorization.middleware import authorize from configuration import configuration from models.config import Action, Configuration diff --git a/src/app/endpoints/conversations.py b/src/app/endpoints/conversations.py index d13f16407..68f3e485c 100644 --- a/src/app/endpoints/conversations.py +++ b/src/app/endpoints/conversations.py @@ -10,7 +10,7 @@ from client import AsyncLlamaStackClientHolder from configuration import configuration from app.database import get_session -from auth import get_auth_dependency +from authentication import get_auth_dependency from authorization.middleware import authorize from models.config import Action from models.database.conversations import UserConversation diff --git a/src/app/endpoints/feedback.py b/src/app/endpoints/feedback.py index f809d4c70..ccf5d5aca 100644 --- a/src/app/endpoints/feedback.py +++ b/src/app/endpoints/feedback.py @@ -8,8 +8,8 @@ from datetime import datetime, UTC from fastapi import APIRouter, HTTPException, Depends, Request, status -from auth import get_auth_dependency -from auth.interface import AuthTuple +from authentication import get_auth_dependency +from authentication.interface import AuthTuple from authorization.middleware import authorize from configuration import configuration from models.config import Action diff --git a/src/app/endpoints/health.py b/src/app/endpoints/health.py index b3c966859..03d7789b5 100644 --- a/src/app/endpoints/health.py +++ b/src/app/endpoints/health.py @@ -12,8 +12,8 @@ from fastapi import APIRouter, status, Response, Depends from client import AsyncLlamaStackClientHolder -from auth.interface import AuthTuple -from auth import get_auth_dependency +from authentication.interface import AuthTuple +from authentication import get_auth_dependency from authorization.middleware import authorize from models.config import Action from models.responses import ( diff --git a/src/app/endpoints/info.py b/src/app/endpoints/info.py index dcb094beb..00608ffbf 100644 --- a/src/app/endpoints/info.py +++ b/src/app/endpoints/info.py @@ -7,8 +7,8 @@ from fastapi import Depends from llama_stack_client import APIConnectionError -from auth.interface import AuthTuple -from auth import get_auth_dependency +from authentication.interface import AuthTuple +from authentication import get_auth_dependency from authorization.middleware import authorize from configuration import configuration from client import AsyncLlamaStackClientHolder diff --git a/src/app/endpoints/metrics.py b/src/app/endpoints/metrics.py index e45e6c668..9bc938f63 100644 --- a/src/app/endpoints/metrics.py +++ b/src/app/endpoints/metrics.py @@ -8,8 +8,8 @@ CONTENT_TYPE_LATEST, ) -from auth.interface import AuthTuple -from auth import get_auth_dependency +from authentication.interface import AuthTuple +from authentication import get_auth_dependency from authorization.middleware import authorize from models.config import Action from metrics.utils import setup_model_metrics diff --git a/src/app/endpoints/models.py b/src/app/endpoints/models.py index cdd85b930..e60597458 100644 --- a/src/app/endpoints/models.py +++ b/src/app/endpoints/models.py @@ -7,8 +7,8 @@ from fastapi.params import Depends from llama_stack_client import APIConnectionError -from auth import get_auth_dependency -from auth.interface import AuthTuple +from authentication import get_auth_dependency +from authentication.interface import AuthTuple from client import AsyncLlamaStackClientHolder from configuration import configuration from authorization.middleware import authorize diff --git a/src/app/endpoints/query.py b/src/app/endpoints/query.py index 5705ba269..43c3eb603 100644 --- a/src/app/endpoints/query.py +++ b/src/app/endpoints/query.py @@ -18,8 +18,8 @@ from fastapi import APIRouter, HTTPException, Request, status, Depends -from auth import get_auth_dependency -from auth.interface import AuthTuple +from authentication import get_auth_dependency +from authentication.interface import AuthTuple from client import AsyncLlamaStackClientHolder from configuration import configuration from app.database import get_session diff --git a/src/app/endpoints/root.py b/src/app/endpoints/root.py index b02234042..080dd37ae 100644 --- a/src/app/endpoints/root.py +++ b/src/app/endpoints/root.py @@ -6,8 +6,8 @@ from fastapi import APIRouter, Request, Depends from fastapi.responses import HTMLResponse -from auth.interface import AuthTuple -from auth import get_auth_dependency +from authentication.interface import AuthTuple +from authentication import get_auth_dependency from authorization.middleware import authorize from models.config import Action diff --git a/src/app/endpoints/streaming_query.py b/src/app/endpoints/streaming_query.py index d6007e962..60d9d4d6e 100644 --- a/src/app/endpoints/streaming_query.py +++ b/src/app/endpoints/streaming_query.py @@ -20,8 +20,8 @@ from fastapi import APIRouter, HTTPException, Request, Depends, status from fastapi.responses import StreamingResponse -from auth import get_auth_dependency -from auth.interface import AuthTuple +from authentication import get_auth_dependency +from authentication.interface import AuthTuple from authorization.middleware import authorize from client import AsyncLlamaStackClientHolder from configuration import configuration diff --git a/src/authentication/__init__.py b/src/authentication/__init__.py index 90da1bcb9..ec0a171d0 100644 --- a/src/authentication/__init__.py +++ b/src/authentication/__init__.py @@ -2,8 +2,8 @@ import logging -from auth.interface import AuthInterface -from auth import noop, noop_with_token, k8s, jwk_token +from authentication.interface import AuthInterface +from authentication import noop, noop_with_token, k8s, jwk_token from configuration import configuration import constants diff --git a/src/authentication/jwk_token.py b/src/authentication/jwk_token.py index e18ab0aea..e10bf81a9 100644 --- a/src/authentication/jwk_token.py +++ b/src/authentication/jwk_token.py @@ -18,8 +18,8 @@ from constants import ( DEFAULT_VIRTUAL_PATH, ) -from auth.interface import NO_AUTH_TUPLE, AuthInterface, AuthTuple -from auth.utils import extract_user_token +from authentication.interface import NO_AUTH_TUPLE, AuthInterface, AuthTuple +from authentication.utils import extract_user_token from models.config import JwkConfiguration logger = logging.getLogger(__name__) diff --git a/src/authentication/k8s.py b/src/authentication/k8s.py index 3479cb40e..4a401455c 100644 --- a/src/authentication/k8s.py +++ b/src/authentication/k8s.py @@ -11,7 +11,7 @@ from kubernetes.config import ConfigException from configuration import configuration -from auth.interface import AuthInterface +from authentication.interface import AuthInterface from constants import DEFAULT_VIRTUAL_PATH logger = logging.getLogger(__name__) diff --git a/src/authentication/noop.py b/src/authentication/noop.py index 07da498d8..48325a650 100644 --- a/src/authentication/noop.py +++ b/src/authentication/noop.py @@ -10,7 +10,7 @@ NO_USER_TOKEN, DEFAULT_VIRTUAL_PATH, ) -from auth.interface import AuthInterface +from authentication.interface import AuthInterface logger = logging.getLogger(__name__) diff --git a/src/authentication/noop_with_token.py b/src/authentication/noop_with_token.py index 5bbd3c774..7deb865ed 100644 --- a/src/authentication/noop_with_token.py +++ b/src/authentication/noop_with_token.py @@ -18,8 +18,8 @@ DEFAULT_USER_UID, DEFAULT_VIRTUAL_PATH, ) -from auth.interface import AuthInterface -from auth.utils import extract_user_token +from authentication.interface import AuthInterface +from authentication.utils import extract_user_token logger = logging.getLogger(__name__) diff --git a/src/authorization/resolvers.py b/src/authorization/resolvers.py index 760f55d74..7531b169d 100644 --- a/src/authorization/resolvers.py +++ b/src/authorization/resolvers.py @@ -8,7 +8,7 @@ from jsonpath_ng import parse -from auth.interface import AuthTuple +from authentication.interface import AuthTuple from models.config import JwtRoleRule, AccessRule, JsonPathOperator, Action import constants diff --git a/src/lightspeed_stack.py b/src/lightspeed_stack.py index d93bcfd82..4065472ba 100644 --- a/src/lightspeed_stack.py +++ b/src/lightspeed_stack.py @@ -84,6 +84,7 @@ def main() -> None: # check if the Llama Stack version is supported by the service asyncio.run(check_llama_stack_version(client)) + # if every previous steps don't fail, start the service on specified port start_uvicorn(configuration.service_configuration) logger.info("Lightspeed stack finished") From 4c2b26c9a5aadfd3d4c87589a31cb08150d0bf07 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 15 Sep 2025 09:59:41 +0200 Subject: [PATCH 4/5] Updated all tests accordingly --- tests/unit/app/endpoints/test_authorized.py | 2 +- tests/unit/authentication/test_auth.py | 4 +-- tests/unit/authentication/test_jwk_token.py | 2 +- tests/unit/authentication/test_k8s.py | 30 ++++++++++--------- tests/unit/authentication/test_noop.py | 2 +- .../authentication/test_noop_with_token.py | 2 +- tests/unit/authentication/test_utils.py | 2 +- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/tests/unit/app/endpoints/test_authorized.py b/tests/unit/app/endpoints/test_authorized.py index 160bbe1ec..7552a48af 100644 --- a/tests/unit/app/endpoints/test_authorized.py +++ b/tests/unit/app/endpoints/test_authorized.py @@ -5,7 +5,7 @@ from starlette.datastructures import Headers from app.endpoints.authorized import authorized_endpoint_handler -from auth.utils import extract_user_token +from authentication.utils import extract_user_token MOCK_AUTH = ("test-id", "test-user", True, "token") diff --git a/tests/unit/authentication/test_auth.py b/tests/unit/authentication/test_auth.py index 436d2fc23..33ca37481 100644 --- a/tests/unit/authentication/test_auth.py +++ b/tests/unit/authentication/test_auth.py @@ -1,7 +1,7 @@ """Unit tests for functions defined in auth/__init__.py""" -from auth import get_auth_dependency -from auth import noop, noop_with_token, k8s +from authentication import get_auth_dependency +from authentication import noop, noop_with_token, k8s from constants import AUTH_MOD_NOOP, AUTH_MOD_NOOP_WITH_TOKEN, AUTH_MOD_K8S from configuration import configuration diff --git a/tests/unit/authentication/test_jwk_token.py b/tests/unit/authentication/test_jwk_token.py index 296e17f51..27ceeefca 100644 --- a/tests/unit/authentication/test_jwk_token.py +++ b/tests/unit/authentication/test_jwk_token.py @@ -9,7 +9,7 @@ from pydantic import AnyHttpUrl from authlib.jose import JsonWebKey, JsonWebToken -from auth.jwk_token import JwkTokenAuthDependency, _jwk_cache +from authentication.jwk_token import JwkTokenAuthDependency, _jwk_cache from constants import DEFAULT_USER_NAME, DEFAULT_USER_UID, NO_USER_TOKEN from models.config import JwkConfiguration, JwtConfiguration diff --git a/tests/unit/authentication/test_k8s.py b/tests/unit/authentication/test_k8s.py index 85608fe9c..6ad0b9d97 100644 --- a/tests/unit/authentication/test_k8s.py +++ b/tests/unit/authentication/test_k8s.py @@ -9,7 +9,7 @@ from kubernetes.client import AuthenticationV1Api, AuthorizationV1Api from kubernetes.client.rest import ApiException -from auth.k8s import ( +from authentication.k8s import ( K8sClientSingleton, K8SAuthDependency, ClusterIDUnavailableError, @@ -75,8 +75,8 @@ async def test_auth_dependency_valid_token(mocker): dependency = K8SAuthDependency() # Mock the Kubernetes API calls - mock_authn_api = mocker.patch("auth.k8s.K8sClientSingleton.get_authn_api") - mock_authz_api = mocker.patch("auth.k8s.K8sClientSingleton.get_authz_api") + mock_authn_api = mocker.patch("authentication.k8s.K8sClientSingleton.get_authn_api") + mock_authz_api = mocker.patch("authentication.k8s.K8sClientSingleton.get_authz_api") # Mock a successful token review response mock_authn_api.return_value.create_token_review.return_value = MockK8sResponse( @@ -108,8 +108,8 @@ async def test_auth_dependency_invalid_token(mocker): dependency = K8SAuthDependency() # Mock the Kubernetes API calls - mock_authn_api = mocker.patch("auth.k8s.K8sClientSingleton.get_authn_api") - mock_authz_api = mocker.patch("auth.k8s.K8sClientSingleton.get_authz_api") + mock_authn_api = mocker.patch("authentication.k8s.K8sClientSingleton.get_authn_api") + mock_authz_api = mocker.patch("authentication.k8s.K8sClientSingleton.get_authz_api") # Setup mock responses for invalid token mock_authn_api.return_value.create_token_review.return_value = MockK8sResponse( @@ -138,7 +138,7 @@ async def test_auth_dependency_invalid_token(mocker): async def test_cluster_id_is_used_for_kube_admin(mocker): """Test the cluster id is used as user_id when user is kube:admin.""" dependency = K8SAuthDependency() - mock_authz_api = mocker.patch("auth.k8s.K8sClientSingleton.get_authz_api") + mock_authz_api = mocker.patch("authentication.k8s.K8sClientSingleton.get_authz_api") mock_authz_api.return_value.create_subject_access_review.return_value = ( MockK8sResponse(allowed=True) ) @@ -152,7 +152,7 @@ async def test_cluster_id_is_used_for_kube_admin(mocker): ) mocker.patch( - "auth.k8s.get_user_info", + "authentication.k8s.get_user_info", return_value=MockK8sResponseStatus( authenticated=True, allowed=True, @@ -162,7 +162,7 @@ async def test_cluster_id_is_used_for_kube_admin(mocker): ), ) mocker.patch( - "auth.k8s.K8sClientSingleton.get_cluster_id", + "authentication.k8s.K8sClientSingleton.get_cluster_id", return_value="some-cluster-id", ) @@ -192,7 +192,7 @@ def test_auth_dependency_config(mocker): def test_get_cluster_id(mocker): """Test get_cluster_id function.""" mock_get_custom_objects_api = mocker.patch( - "auth.k8s.K8sClientSingleton.get_custom_objects_api" + "authentication.k8s.K8sClientSingleton.get_custom_objects_api" ) cluster_id = {"spec": {"clusterID": "some-cluster-id"}} @@ -230,9 +230,11 @@ def test_get_cluster_id(mocker): def test_get_cluster_id_in_cluster(mocker): """Test get_cluster_id function when running inside of cluster.""" - mocker.patch("auth.k8s.RUNNING_IN_CLUSTER", True) - mocker.patch("auth.k8s.K8sClientSingleton.__new__") - mock_get_cluster_id = mocker.patch("auth.k8s.K8sClientSingleton._get_cluster_id") + mocker.patch("authentication.k8s.RUNNING_IN_CLUSTER", True) + mocker.patch("authentication.k8s.K8sClientSingleton.__new__") + mock_get_cluster_id = mocker.patch( + "authentication.k8s.K8sClientSingleton._get_cluster_id" + ) mock_get_cluster_id.return_value = "some-cluster-id" assert K8sClientSingleton.get_cluster_id() == "some-cluster-id" @@ -240,8 +242,8 @@ def test_get_cluster_id_in_cluster(mocker): def test_get_cluster_id_outside_of_cluster(mocker): """Test get_cluster_id function when running outside of cluster.""" - mocker.patch("auth.k8s.RUNNING_IN_CLUSTER", False) - mocker.patch("auth.k8s.K8sClientSingleton.__new__") + mocker.patch("authentication.k8s.RUNNING_IN_CLUSTER", False) + mocker.patch("authentication.k8s.K8sClientSingleton.__new__") # ensure cluster_id is None to trigger the condition K8sClientSingleton._cluster_id = None diff --git a/tests/unit/authentication/test_noop.py b/tests/unit/authentication/test_noop.py index 0ead030e6..917cbec5d 100644 --- a/tests/unit/authentication/test_noop.py +++ b/tests/unit/authentication/test_noop.py @@ -1,7 +1,7 @@ """Unit tests for functions defined in auth/noop.py""" from fastapi import Request -from auth.noop import NoopAuthDependency +from authentication.noop import NoopAuthDependency from constants import DEFAULT_USER_NAME, DEFAULT_USER_UID, NO_USER_TOKEN diff --git a/tests/unit/authentication/test_noop_with_token.py b/tests/unit/authentication/test_noop_with_token.py index c5003f203..609d61bad 100644 --- a/tests/unit/authentication/test_noop_with_token.py +++ b/tests/unit/authentication/test_noop_with_token.py @@ -3,7 +3,7 @@ from fastapi import Request, HTTPException import pytest -from auth.noop_with_token import NoopWithTokenAuthDependency +from authentication.noop_with_token import NoopWithTokenAuthDependency from constants import DEFAULT_USER_NAME, DEFAULT_USER_UID diff --git a/tests/unit/authentication/test_utils.py b/tests/unit/authentication/test_utils.py index fe34cdaaf..c7bc893e0 100644 --- a/tests/unit/authentication/test_utils.py +++ b/tests/unit/authentication/test_utils.py @@ -3,7 +3,7 @@ from fastapi import HTTPException from starlette.datastructures import Headers -from auth.utils import extract_user_token +from authentication.utils import extract_user_token def test_extract_user_token(): From db2748338be0b5ef598320e3519b14246e008274 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 15 Sep 2025 10:02:52 +0200 Subject: [PATCH 5/5] Module name in Python project file --- pyproject.toml | 4 ++-- src/authentication/noop_with_token.py | 2 +- tests/unit/authentication/test_auth.py | 2 +- tests/unit/authentication/test_jwk_token.py | 2 +- tests/unit/authentication/test_k8s.py | 2 +- tests/unit/authentication/test_noop.py | 2 +- tests/unit/authentication/test_noop_with_token.py | 2 +- tests/unit/authentication/test_utils.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 725ce19d4..93c4d1f60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ # Used for HTTP service base "fastapi>=0.115.12", "uvicorn>=0.34.3", - # Used by auth/k8s integration + # Used by authentication/k8s integration "kubernetes>=30.1.0", # Used to call Llama Stack APIs "llama-stack==0.2.19", @@ -58,7 +58,7 @@ exclude = [ # TODO(lucasagomes): This module was copied from road-core # service/ols/src/auth/k8s.py and currently has 58 Pyright issues. It # might need to be rewritten down the line. - "src/auth/k8s.py", + "src/authentication/k8s.py", ] extraPaths = ["./src"] diff --git a/src/authentication/noop_with_token.py b/src/authentication/noop_with_token.py index 7deb865ed..b7131d8ab 100644 --- a/src/authentication/noop_with_token.py +++ b/src/authentication/noop_with_token.py @@ -3,7 +3,7 @@ Intended for local/dev use only — do not use in production. Behavior: -- Reads a user token from request headers via `auth.utils.extract_user_token`. +- Reads a user token from request headers via `authentication.utils.extract_user_token`. - Reads `user_id` from query params (falls back to `DEFAULT_USER_UID`) and pairs it with `DEFAULT_USER_NAME`. - Returns a tuple: (user_id, DEFAULT_USER_NAME, user_token). diff --git a/tests/unit/authentication/test_auth.py b/tests/unit/authentication/test_auth.py index 33ca37481..58f15d645 100644 --- a/tests/unit/authentication/test_auth.py +++ b/tests/unit/authentication/test_auth.py @@ -1,4 +1,4 @@ -"""Unit tests for functions defined in auth/__init__.py""" +"""Unit tests for functions defined in authentication/__init__.py""" from authentication import get_auth_dependency from authentication import noop, noop_with_token, k8s diff --git a/tests/unit/authentication/test_jwk_token.py b/tests/unit/authentication/test_jwk_token.py index 27ceeefca..0dc16f1ad 100644 --- a/tests/unit/authentication/test_jwk_token.py +++ b/tests/unit/authentication/test_jwk_token.py @@ -1,6 +1,6 @@ # pylint: disable=redefined-outer-name -"""Unit tests for functions defined in auth/jwk_token.py""" +"""Unit tests for functions defined in authentication/jwk_token.py""" import time diff --git a/tests/unit/authentication/test_k8s.py b/tests/unit/authentication/test_k8s.py index 6ad0b9d97..b63ff5fe2 100644 --- a/tests/unit/authentication/test_k8s.py +++ b/tests/unit/authentication/test_k8s.py @@ -1,4 +1,4 @@ -"""Unit tests for auth/k8s module.""" +"""Unit tests for authentication/k8s module.""" # pylint: disable=too-many-arguments,too-many-positional-arguments,too-few-public-methods,protected-access diff --git a/tests/unit/authentication/test_noop.py b/tests/unit/authentication/test_noop.py index 917cbec5d..1e1460d05 100644 --- a/tests/unit/authentication/test_noop.py +++ b/tests/unit/authentication/test_noop.py @@ -1,4 +1,4 @@ -"""Unit tests for functions defined in auth/noop.py""" +"""Unit tests for functions defined in authentication/noop.py""" from fastapi import Request from authentication.noop import NoopAuthDependency diff --git a/tests/unit/authentication/test_noop_with_token.py b/tests/unit/authentication/test_noop_with_token.py index 609d61bad..61048a41c 100644 --- a/tests/unit/authentication/test_noop_with_token.py +++ b/tests/unit/authentication/test_noop_with_token.py @@ -1,4 +1,4 @@ -"""Unit tests for functions defined in auth/noop_with_token.py""" +"""Unit tests for functions defined in authentication/noop_with_token.py""" from fastapi import Request, HTTPException import pytest diff --git a/tests/unit/authentication/test_utils.py b/tests/unit/authentication/test_utils.py index c7bc893e0..a0d64ac97 100644 --- a/tests/unit/authentication/test_utils.py +++ b/tests/unit/authentication/test_utils.py @@ -1,4 +1,4 @@ -"""Unit tests for functions defined in auth/utils.py""" +"""Unit tests for functions defined in authentication/utils.py""" from fastapi import HTTPException from starlette.datastructures import Headers