Skip to content

Commit f9e08b4

Browse files
committed
Use public auth_schema module for AuthenticationToken
1 parent c2b1b32 commit f9e08b4

File tree

1 file changed

+5
-3
lines changed
  • src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/conda-store/config

1 file changed

+5
-3
lines changed

src/_nebari/stages/kubernetes_services/template/modules/kubernetes/services/conda-store/config/conda_store_config.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
from pathlib import Path
1111

1212
import requests
13+
1314
from conda_store_server import api
1415
from conda_store_server._internal import schema
16+
from conda_store_server.server import schema as auth_schema
1517
from conda_store_server._internal.server.dependencies import get_conda_store
1618
from conda_store_server.server.auth import GenericOAuthAuthentication
1719
from conda_store_server.storage import S3Storage
@@ -357,7 +359,7 @@ def _get_conda_store_client_roles_for_user(
357359
return client_roles_rich
358360

359361
def _get_current_entity_bindings(self, username):
360-
entity = schema.AuthenticationToken(
362+
entity = auth_schema.AuthenticationToken(
361363
primary_namespace=username, role_bindings={}
362364
)
363365
self.log.info(f"entity: {entity}")
@@ -387,7 +389,7 @@ async def authenticate(self, request):
387389

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

428-
return schema.AuthenticationToken(
430+
return auth_schema.AuthenticationToken(
429431
primary_namespace=username,
430432
role_bindings=role_bindings,
431433
)

0 commit comments

Comments
 (0)