|
10 | 10 | from pathlib import Path |
11 | 11 |
|
12 | 12 | import requests |
| 13 | + |
13 | 14 | from conda_store_server import api |
14 | 15 | from conda_store_server._internal import schema |
| 16 | +from conda_store_server.server import schema as auth_schema |
15 | 17 | from conda_store_server._internal.server.dependencies import get_conda_store |
16 | 18 | from conda_store_server.server.auth import GenericOAuthAuthentication |
17 | 19 | from conda_store_server.storage import S3Storage |
@@ -357,7 +359,7 @@ def _get_conda_store_client_roles_for_user( |
357 | 359 | return client_roles_rich |
358 | 360 |
|
359 | 361 | def _get_current_entity_bindings(self, username): |
360 | | - entity = schema.AuthenticationToken( |
| 362 | + entity = auth_schema.AuthenticationToken( |
361 | 363 | primary_namespace=username, role_bindings={} |
362 | 364 | ) |
363 | 365 | self.log.info(f"entity: {entity}") |
@@ -387,7 +389,7 @@ async def authenticate(self, request): |
387 | 389 |
|
388 | 390 | # superadmin gets access to everything |
389 | 391 | if "conda_store_superadmin" in user_data.get("roles", []): |
390 | | - return schema.AuthenticationToken( |
| 392 | + return auth_schema.AuthenticationToken( |
391 | 393 | primary_namespace=username, |
392 | 394 | role_bindings={"*/*": {"admin"}}, |
393 | 395 | ) |
@@ -425,7 +427,7 @@ async def authenticate(self, request): |
425 | 427 | if _namespace is None: |
426 | 428 | api.ensure_namespace(db, name=namespace) |
427 | 429 |
|
428 | | - return schema.AuthenticationToken( |
| 430 | + return auth_schema.AuthenticationToken( |
429 | 431 | primary_namespace=username, |
430 | 432 | role_bindings=role_bindings, |
431 | 433 | ) |
|
0 commit comments