Skip to content

Commit

Permalink
Merge pull request #1236 from Agenta-AI/oss/rbac
Browse files Browse the repository at this point in the history
Feat - RBAC Implementation and Non-OSS Feature Removal
  • Loading branch information
aakrem authored Feb 14, 2024
2 parents feefe45 + 494769b commit 1b3d5e6
Show file tree
Hide file tree
Showing 59 changed files with 3,281 additions and 2,312 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-python-code-black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
- uses: psf/black@23.12.0
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ agenta-web/cypress/screenshots/
agenta-web/cypress/videos/
.nextjs_cache/

rabbitmq_data
rabbitmq_data

# docker compose override
docker-compose.*override.yaml
14 changes: 5 additions & 9 deletions agenta-backend/agenta_backend/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import asyncio
from contextlib import asynccontextmanager

Expand All @@ -12,18 +11,18 @@
human_evaluation_router,
evaluators_router,
observability_router,
organization_router,
testset_router,
user_profile,
variants_router,
bases_router,
configs_router,
health_router,
)
from agenta_backend.utils.common import isCloudEE
from agenta_backend.models.db_engine import DBEngine
from agenta_backend.open_api import open_api_tags_metadata

if os.environ["FEATURE_FLAG"] in ["cloud", "ee"]:
if isCloudEE():
from agenta_backend.commons.services import templates_manager
else:
from agenta_backend.services import templates_manager
Expand Down Expand Up @@ -71,12 +70,12 @@ async def lifespan(application: FastAPI, cache=True):
allow_headers=allow_headers,
)

if os.environ["FEATURE_FLAG"] not in ["cloud", "ee"]:
if not isCloudEE():
from agenta_backend.services.auth_helper import authentication_middleware

app.middleware("http")(authentication_middleware)

if os.environ["FEATURE_FLAG"] in ["cloud", "ee"]:
if isCloudEE():
import agenta_backend.cloud.main as cloud

app, allow_headers = cloud.extend_main(app)
Expand All @@ -102,13 +101,10 @@ async def lifespan(application: FastAPI, cache=True):
app.include_router(
observability_router.router, prefix="/observability", tags=["Observability"]
)
app.include_router(
organization_router.router, prefix="/organizations", tags=["Organizations"]
)
app.include_router(bases_router.router, prefix="/bases", tags=["Bases"])
app.include_router(configs_router.router, prefix="/configs", tags=["Configs"])

if os.environ["FEATURE_FLAG"] in ["cloud", "ee"]:
if isCloudEE():
import agenta_backend.cloud.main as cloud

app = cloud.extend_app_schema(app)
Loading

0 comments on commit 1b3d5e6

Please sign in to comment.