Skip to content

Commit

Permalink
refactor (backend): retrieve api_key from headers properly
Browse files Browse the repository at this point in the history
  • Loading branch information
aybruhm committed Dec 20, 2024
1 parent 7b7d8f7 commit e741644
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions agenta-backend/agenta_backend/routers/app_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,11 @@ async def create_app(
"""
try:
if isCloudEE():
api_key_from_headers = request.headers.get("Authorization")
api_key_from_headers = request.headers.get("Authorization", None)
if api_key_from_headers is not None:
api_key = api_key_from_headers.split(" ")[-1] # ["ApiKey", "xxxxx.xxxxxx"]
await check_apikey_action_access(
api_key_from_headers,
api_key,
request.state.user_id,
Permission.CREATE_APPLICATION,
)
Expand Down

0 comments on commit e741644

Please sign in to comment.