Skip to content
Snippets Groups Projects
Commit 72ba2bb1 authored by Mohammad Torkashvand's avatar Mohammad Torkashvand
Browse files

remove unused code for auth

parent 61eef98f
No related branches found
No related tags found
1 merge request!233remove unused code for auth
Pipeline #87963 passed
"""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()
......@@ -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"
}
}
......@@ -171,12 +171,6 @@ class SharepointParams(BaseSettings):
scopes: list[str]
class AuthParams(BaseSettings):
"""Parameters for the authentication service."""
opa_url: str
class OSSParams(BaseSettings):
"""The set of parameters required for running :term:`GSO`."""
......@@ -189,7 +183,6 @@ class OSSParams(BaseSettings):
THIRD_PARTY_API_KEYS: dict[str, str]
EMAIL: EmailParams
SHAREPOINT: SharepointParams
AUTH: AuthParams
def load_oss_params() -> OSSParams:
......
......@@ -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)
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment