Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dependency]: Access control in API Keys #2147

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions agenta-backend/agenta_backend/routers/app_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,8 @@ async def create_app(
Permission.CREATE_APPLICATION,
)

workspace_id_from_apikey = await db_manager_ee.get_workspace_id_from_apikey(
api_key_from_headers, request.state.user_id
)
if payload.workspace_id is None:
payload.workspace_id = workspace_id_from_apikey
payload.workspace_id = request.state.workspace_id

try:
user_org_workspace_data = await get_user_org_and_workspace_id(
Expand Down
3 changes: 1 addition & 2 deletions agenta-backend/agenta_backend/services/app_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ async def start_variant(
)
if isCloudEE():
user = await db_manager.get_user(user_uid=user_uid)
project = await db_manager_ee.get_project_by_id(project_id=project_id)
api_key = await api_key_service.create_api_key(
str(user.id),
workspace_id=str(project.workspace_id),
project_id=project_id,
expiration_date=None,
hidden=True,
)
Expand Down
Loading