diff --git a/tests/test_litellm/auth_v2/auth_v2_helpers.py b/tests/test_litellm/proxy/auth_v2/auth_v2_helpers.py similarity index 100% rename from tests/test_litellm/auth_v2/auth_v2_helpers.py rename to tests/test_litellm/proxy/auth_v2/auth_v2_helpers.py diff --git a/tests/test_litellm/auth_v2/conftest.py b/tests/test_litellm/proxy/auth_v2/conftest.py similarity index 91% rename from tests/test_litellm/auth_v2/conftest.py rename to tests/test_litellm/proxy/auth_v2/conftest.py index 3a1b8af831c..fe4df1984e0 100644 --- a/tests/test_litellm/auth_v2/conftest.py +++ b/tests/test_litellm/proxy/auth_v2/conftest.py @@ -6,8 +6,8 @@ import pytest from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import rsa -from litellm.auth_v2.authenticators import JwtVerifier -from litellm.auth_v2.config import OidcProviderConfig +from litellm.proxy.auth_v2.authenticators import JwtVerifier +from litellm.proxy.auth_v2.config import OidcProviderConfig from auth_v2_helpers import TEST_AUDIENCE, TEST_ISSUER, FakeJwksClient, TokenFactory diff --git a/tests/test_litellm/auth_v2/test_authenticators.py b/tests/test_litellm/proxy/auth_v2/test_authenticators.py similarity index 98% rename from tests/test_litellm/auth_v2/test_authenticators.py rename to tests/test_litellm/proxy/auth_v2/test_authenticators.py index 791c3f07f74..78a788430e6 100644 --- a/tests/test_litellm/auth_v2/test_authenticators.py +++ b/tests/test_litellm/proxy/auth_v2/test_authenticators.py @@ -6,7 +6,7 @@ from unittest.mock import AsyncMock, MagicMock, patch import pytest -from litellm.auth_v2.authenticators import ( +from litellm.proxy.auth_v2.authenticators import ( ApiKeyAuthenticator, HttpAuthenticator, JwtVerifier, @@ -15,7 +15,7 @@ from litellm.auth_v2.authenticators import ( OidcAuthenticator, build_authenticators, ) -from litellm.auth_v2.config import ( +from litellm.proxy.auth_v2.config import ( ApiKeySchemeConfig, AuthConfig, HttpBasicConfig, @@ -23,8 +23,8 @@ from litellm.auth_v2.config import ( OAuth2IntrospectionConfig, OidcProviderConfig, ) -from litellm.auth_v2.errors import AuthError -from litellm.auth_v2.models import AuthMethod, SecuritySchemeType +from litellm.proxy.auth_v2.errors import AuthError +from litellm.proxy.auth_v2.models import AuthMethod, SecuritySchemeType from auth_v2_helpers import ( TEST_AUDIENCE, diff --git a/tests/test_litellm/auth_v2/test_config.py b/tests/test_litellm/proxy/auth_v2/test_config.py similarity index 97% rename from tests/test_litellm/auth_v2/test_config.py rename to tests/test_litellm/proxy/auth_v2/test_config.py index 8050ef3eba0..86da462fff7 100644 --- a/tests/test_litellm/auth_v2/test_config.py +++ b/tests/test_litellm/proxy/auth_v2/test_config.py @@ -3,7 +3,7 @@ from __future__ import annotations import pytest from pydantic import ValidationError -from litellm.auth_v2.config import ( +from litellm.proxy.auth_v2.config import ( OAuth2IntrospectionConfig, OidcProviderConfig, SamlConfig, diff --git a/tests/test_litellm/auth_v2/test_models.py b/tests/test_litellm/proxy/auth_v2/test_models.py similarity index 96% rename from tests/test_litellm/auth_v2/test_models.py rename to tests/test_litellm/proxy/auth_v2/test_models.py index f77bf0f3cbc..4c0a5e74f9d 100644 --- a/tests/test_litellm/auth_v2/test_models.py +++ b/tests/test_litellm/proxy/auth_v2/test_models.py @@ -3,7 +3,7 @@ from __future__ import annotations import pytest from pydantic import ValidationError -from litellm.auth_v2.models import ( +from litellm.proxy.auth_v2.models import ( AuthMethod, Credential, Principal, @@ -13,7 +13,7 @@ from litellm.auth_v2.models import ( TeamRole, UserIdentity, ) -from litellm.auth_v2.rbac import Role +from litellm.proxy.auth_v2.rbac import Role def _credential() -> Credential: diff --git a/tests/test_litellm/auth_v2/test_network.py b/tests/test_litellm/proxy/auth_v2/test_network.py similarity index 94% rename from tests/test_litellm/auth_v2/test_network.py rename to tests/test_litellm/proxy/auth_v2/test_network.py index 968130d2d6a..e0804524670 100644 --- a/tests/test_litellm/auth_v2/test_network.py +++ b/tests/test_litellm/proxy/auth_v2/test_network.py @@ -1,7 +1,7 @@ from __future__ import annotations -from litellm.auth_v2.config import TrustedProxyConfig -from litellm.auth_v2.network import resolve_client_ip, resolve_network_context +from litellm.proxy.auth_v2.config import TrustedProxyConfig +from litellm.proxy.auth_v2.network import resolve_client_ip, resolve_network_context from auth_v2_helpers import make_request diff --git a/tests/test_litellm/auth_v2/test_oidc.py b/tests/test_litellm/proxy/auth_v2/test_oidc.py similarity index 88% rename from tests/test_litellm/auth_v2/test_oidc.py rename to tests/test_litellm/proxy/auth_v2/test_oidc.py index c2b04c571f2..52218423d6e 100644 --- a/tests/test_litellm/auth_v2/test_oidc.py +++ b/tests/test_litellm/proxy/auth_v2/test_oidc.py @@ -1,8 +1,8 @@ from __future__ import annotations -from litellm.auth_v2.config import OidcProviderConfig -from litellm.auth_v2.oidc import _provider_key, _user_from_userinfo -from litellm.auth_v2.resolver import InMemoryIdentityStore +from litellm.proxy.auth_v2.config import OidcProviderConfig +from litellm.proxy.auth_v2.oidc import _provider_key, _user_from_userinfo +from litellm.proxy.auth_v2.resolver import InMemoryIdentityStore def test_userinfo_maps_standard_claims_to_scim_user(): diff --git a/tests/test_litellm/auth_v2/test_rbac.py b/tests/test_litellm/proxy/auth_v2/test_rbac.py similarity index 96% rename from tests/test_litellm/auth_v2/test_rbac.py rename to tests/test_litellm/proxy/auth_v2/test_rbac.py index 2a83a40ba06..d16432b9fb3 100644 --- a/tests/test_litellm/auth_v2/test_rbac.py +++ b/tests/test_litellm/proxy/auth_v2/test_rbac.py @@ -3,8 +3,8 @@ from __future__ import annotations import pytest from fastapi.security import SecurityScopes -from litellm.auth_v2.models import AuthMethod, Principal, PrincipalType -from litellm.auth_v2.rbac import RbacEngine, Role, has_required_scopes +from litellm.proxy.auth_v2.models import AuthMethod, Principal, PrincipalType +from litellm.proxy.auth_v2.rbac import RbacEngine, Role, has_required_scopes def _principal(*, scopes=None, roles=None) -> Principal: diff --git a/tests/test_litellm/auth_v2/test_resolver.py b/tests/test_litellm/proxy/auth_v2/test_resolver.py similarity index 94% rename from tests/test_litellm/auth_v2/test_resolver.py rename to tests/test_litellm/proxy/auth_v2/test_resolver.py index 6526f314819..3c534b6a4d6 100644 --- a/tests/test_litellm/auth_v2/test_resolver.py +++ b/tests/test_litellm/proxy/auth_v2/test_resolver.py @@ -2,8 +2,8 @@ from __future__ import annotations import pytest -from litellm.auth_v2.errors import AuthError -from litellm.auth_v2.models import ( +from litellm.proxy.auth_v2.errors import AuthError +from litellm.proxy.auth_v2.models import ( AuthMethod, ClientCertificate, Credential, @@ -11,8 +11,8 @@ from litellm.auth_v2.models import ( PrincipalType, SecuritySchemeType, ) -from litellm.auth_v2.rbac import Role -from litellm.auth_v2.resolver import InMemoryIdentityStore, _hash_api_key +from litellm.proxy.auth_v2.rbac import Role +from litellm.proxy.auth_v2.resolver import InMemoryIdentityStore, _hash_api_key def _api_key_credential(raw: str) -> Credential: diff --git a/tests/test_litellm/auth_v2/test_saml.py b/tests/test_litellm/proxy/auth_v2/test_saml.py similarity index 95% rename from tests/test_litellm/auth_v2/test_saml.py rename to tests/test_litellm/proxy/auth_v2/test_saml.py index a4f9f15b68d..83a13c72654 100644 --- a/tests/test_litellm/auth_v2/test_saml.py +++ b/tests/test_litellm/proxy/auth_v2/test_saml.py @@ -94,7 +94,7 @@ def saml_env(tmp_path: Path) -> SamlEnv: from saml2.saml import NAMEID_FORMAT_EMAILADDRESS from saml2.server import Server - from litellm.auth_v2.config import SamlConfig + from litellm.proxy.auth_v2.config import SamlConfig idp_key, idp_cert = _gen_cert(tmp_path, "idp") sp_key, sp_cert = _gen_cert(tmp_path, "sp") @@ -155,10 +155,10 @@ def saml_env(tmp_path: Path) -> SamlEnv: def _build_app(saml_env: SamlEnv): - from litellm.auth_v2.config import AuthConfig - from litellm.auth_v2.models import Principal - from litellm.auth_v2.resolver import InMemoryIdentityStore - from litellm.auth_v2.security import get_current_principal, install_auth + from litellm.proxy.auth_v2.config import AuthConfig + from litellm.proxy.auth_v2.models import Principal + from litellm.proxy.auth_v2.resolver import InMemoryIdentityStore + from litellm.proxy.auth_v2.security import get_current_principal, install_auth app = FastAPI() store = InMemoryIdentityStore() @@ -354,8 +354,8 @@ def test_login_rejects_open_redirect_next(saml_env): def test_map_attributes_applies_attribute_map(): - from litellm.auth_v2.config import DEFAULT_SAML_ATTRIBUTE_MAP - from litellm.auth_v2.saml import _map_attributes + from litellm.proxy.auth_v2.config import DEFAULT_SAML_ATTRIBUTE_MAP + from litellm.proxy.auth_v2.saml import _map_attributes ava = { "email": ["alice@example.com"], @@ -371,7 +371,7 @@ def test_map_attributes_applies_attribute_map(): def test_user_from_mapped_builds_name_and_email(): - from litellm.auth_v2.saml import _user_from_mapped + from litellm.proxy.auth_v2.saml import _user_from_mapped user = _user_from_mapped( "alice@example.com", @@ -398,7 +398,7 @@ def test_user_from_mapped_builds_name_and_email(): ], ) def test_safe_relay_state_blocks_open_redirects(candidate, expected): - from litellm.auth_v2.saml import _safe_relay_state + from litellm.proxy.auth_v2.saml import _safe_relay_state assert _safe_relay_state(candidate, "/") == expected @@ -412,6 +412,6 @@ def test_safe_relay_state_blocks_open_redirects(candidate, expected): ], ) def test_metadata_source_classifies_input(metadata, expected_key): - from litellm.auth_v2.saml import _metadata_source + from litellm.proxy.auth_v2.saml import _metadata_source assert expected_key in _metadata_source(metadata) diff --git a/tests/test_litellm/auth_v2/test_scim.py b/tests/test_litellm/proxy/auth_v2/test_scim.py similarity index 95% rename from tests/test_litellm/auth_v2/test_scim.py rename to tests/test_litellm/proxy/auth_v2/test_scim.py index b58529161bd..06edb468b24 100644 --- a/tests/test_litellm/auth_v2/test_scim.py +++ b/tests/test_litellm/proxy/auth_v2/test_scim.py @@ -4,10 +4,10 @@ import pytest from fastapi import FastAPI from fastapi.testclient import TestClient -from litellm.auth_v2.config import AuthConfig -from litellm.auth_v2.models import AuthMethod, Principal, PrincipalType -from litellm.auth_v2.resolver import InMemoryIdentityStore, _hash_api_key -from litellm.auth_v2.security import install_auth +from litellm.proxy.auth_v2.config import AuthConfig +from litellm.proxy.auth_v2.models import AuthMethod, Principal, PrincipalType +from litellm.proxy.auth_v2.resolver import InMemoryIdentityStore, _hash_api_key +from litellm.proxy.auth_v2.security import install_auth USER_SCHEMA = "urn:ietf:params:scim:schemas:core:2.0:User" GROUP_SCHEMA = "urn:ietf:params:scim:schemas:core:2.0:Group" diff --git a/tests/test_litellm/auth_v2/test_security.py b/tests/test_litellm/proxy/auth_v2/test_security.py similarity index 96% rename from tests/test_litellm/auth_v2/test_security.py rename to tests/test_litellm/proxy/auth_v2/test_security.py index e3e0e10acc0..f9f92c1e0ed 100644 --- a/tests/test_litellm/auth_v2/test_security.py +++ b/tests/test_litellm/proxy/auth_v2/test_security.py @@ -6,21 +6,21 @@ import pytest from fastapi import FastAPI, Security from fastapi.testclient import TestClient -from litellm.auth_v2.authenticators import ( +from litellm.proxy.auth_v2.authenticators import ( ApiKeyAuthenticator, HttpAuthenticator, JwtVerifier, ) -from litellm.auth_v2.config import ( +from litellm.proxy.auth_v2.config import ( ApiKeySchemeConfig, AuthConfig, HttpBasicConfig, OidcProviderConfig, ) -from litellm.auth_v2.models import AuthMethod, Principal, PrincipalType -from litellm.auth_v2.rbac import RbacEngine, Role -from litellm.auth_v2.resolver import InMemoryIdentityStore, _hash_api_key -from litellm.auth_v2.security import ( +from litellm.proxy.auth_v2.models import AuthMethod, Principal, PrincipalType +from litellm.proxy.auth_v2.rbac import RbacEngine, Role +from litellm.proxy.auth_v2.resolver import InMemoryIdentityStore, _hash_api_key +from litellm.proxy.auth_v2.security import ( AuthContext, get_current_principal, require_permission,