Skip to content

Commit

Permalink
fix: handle case where user does not belong to VO supported by the pr…
Browse files Browse the repository at this point in the history
…oject
  • Loading branch information
IgnacioHeredia committed Nov 6, 2024
1 parent 13024bd commit d4a2dbc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ai4papi/routers/v1/deployments/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ def get_deployments(
auth_info = auth.get_user_info(token=authorization.credentials)

# If no VOs, then retrieve jobs from all user VOs
# Else only retrieve from allowed VOs
# Always remove VOs that do not belong to the project
if not vos:
vos = auth_info['vos']
else:
vos = set(vos).intersection(auth_info['vos'])
vos = set(vos).intersection(set(papiconf.MAIN_CONF['auth']['VO']))
if not vos:
raise HTTPException(
status_code=401,
Expand Down Expand Up @@ -201,7 +200,7 @@ def create_deployment(
priority = 50

base_domain = papiconf.MAIN_CONF['lb']['domain'][vo]

# Create a default secret for the Federated Server
_ = ai4secrets.create_secret(
vo=vo,
Expand Down

0 comments on commit d4a2dbc

Please sign in to comment.