Skip to content

Commit

Permalink
Use public auth_schema module for AuthenticationToken
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 committed Jan 31, 2025
1 parent c2b1b32 commit f9e08b4
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
from pathlib import Path

import requests

from conda_store_server import api
from conda_store_server._internal import schema
from conda_store_server.server import schema as auth_schema
from conda_store_server._internal.server.dependencies import get_conda_store
from conda_store_server.server.auth import GenericOAuthAuthentication
from conda_store_server.storage import S3Storage
Expand Down Expand Up @@ -357,7 +359,7 @@ def _get_conda_store_client_roles_for_user(
return client_roles_rich

def _get_current_entity_bindings(self, username):
entity = schema.AuthenticationToken(
entity = auth_schema.AuthenticationToken(
primary_namespace=username, role_bindings={}
)
self.log.info(f"entity: {entity}")
Expand Down Expand Up @@ -387,7 +389,7 @@ async def authenticate(self, request):

# superadmin gets access to everything
if "conda_store_superadmin" in user_data.get("roles", []):
return schema.AuthenticationToken(
return auth_schema.AuthenticationToken(
primary_namespace=username,
role_bindings={"*/*": {"admin"}},
)
Expand Down Expand Up @@ -425,7 +427,7 @@ async def authenticate(self, request):
if _namespace is None:
api.ensure_namespace(db, name=namespace)

return schema.AuthenticationToken(
return auth_schema.AuthenticationToken(
primary_namespace=username,
role_bindings=role_bindings,
)
Expand Down

0 comments on commit f9e08b4

Please sign in to comment.