diff --git a/gso/auth/settings.py b/gso/auth/settings.py deleted file mode 100644 index b3ab1a6a569e2e594e181c23c231366e212f4905..0000000000000000000000000000000000000000 --- a/gso/auth/settings.py +++ /dev/null @@ -1,39 +0,0 @@ -"""Security configurations and utilities for the GSO application. Handles OAuth2 and OpenID Connect. - -authentication and authorization, including token validation and user authentication. Integrates -with external authentication providers for enhanced security management. - -Todo: Remove token and sensitive data from OPA console and API. -""" - -from pydantic import Field -from pydantic_settings import BaseSettings - - -class Oauth2LibSettings(BaseSettings): - """Common settings for applications depending on oauth2.""" - - ENVIRONMENT: str = "local" - SERVICE_NAME: str = "" - MUTATIONS_ENABLED: bool = False - ENVIRONMENT_IGNORE_MUTATION_DISABLED: list[str] = Field( - default_factory=list, description="Environments for which to allow unauthenticated mutations" - ) - OAUTH2_ACTIVE: bool = True - OAUTH2_AUTHORIZATION_ACTIVE: bool = True - - -oauth2lib_settings = Oauth2LibSettings() - - -class Oauth2Settings(BaseSettings): - """Configuration settings for OAuth2 and OpenID Connect (OIDC).""" - - OAUTH2_RESOURCE_SERVER_ID: str = "" - OAUTH2_RESOURCE_SERVER_SECRET: str = "" - OAUTH2_TOKEN_URL: str = "" - OIDC_CONF_WELL_KNOWN_URL: str = "" - OPA_URL: str = "http://localhost:8181/v1/data/gap/gso/api/access" - - -oauth2_settings = Oauth2Settings() diff --git a/gso/oss-params-example.json b/gso/oss-params-example.json index fb59a19bb771389355e9609c95f44c7d6d607be2..2a40269346ad446e4b8fbac6a4f9ed4dafc8a3ea 100644 --- a/gso/oss-params-example.json +++ b/gso/oss-params-example.json @@ -102,8 +102,5 @@ "p_router": "UUID" }, "scopes": ["https://graph.microsoft.com/.default"] - }, - "AUTH": { - "opa_url": "http://127.0.0.1:8181/v1/data/gap/gso/api/access" } } diff --git a/test/auth/test_oidc.py b/test/auth/test_oidc.py index d70b544bb0137d08179c395e3f179f463f0e396f..350d52779d573bc5530bef1d3489a35ec62578f2 100644 --- a/test/auth/test_oidc.py +++ b/test/auth/test_oidc.py @@ -5,6 +5,7 @@ import pytest from fastapi import HTTPException, Request from httpx import AsyncClient, NetworkError, Response from oauth2_lib.fastapi import OIDCConfig +from oauth2_lib.settings import oauth2lib_settings from gso.auth.oidc import ( OIDCAuthentication, @@ -12,7 +13,6 @@ from gso.auth.oidc import ( _is_callback_step_endpoint, ) from gso.auth.opa import _get_decision -from gso.auth.settings import oauth2lib_settings @pytest.fixture(scope="module", autouse=True) diff --git a/test/conftest.py b/test/conftest.py index d0391c02ab4c83b0c3d0cc98a418dabe11c9e5ad..d450ab43e176bc08a6b5e5658b8814b30801316f 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -11,6 +11,7 @@ from alembic import command from alembic.config import Config from faker import Faker from faker.providers import BaseProvider +from oauth2_lib.settings import oauth2lib_settings from orchestrator import app_settings from orchestrator.db import ( Database, @@ -30,7 +31,6 @@ from sqlalchemy.engine import make_url from sqlalchemy.orm import scoped_session, sessionmaker from starlette.testclient import TestClient -from gso.auth.settings import oauth2lib_settings from gso.db.models import PartnerType from gso.main import init_gso_app from gso.schema.partner import PartnerCreate