Skip to content

Commit 3b92186

Browse files
committed
feat: use the amalthea session cache
1 parent ea658b8 commit 3b92186

File tree

7 files changed

+9
-13
lines changed

7 files changed

+9
-13
lines changed

components/renku_data_services/authn/dummy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def authenticate(self, access_token: str, request: Request) -> base_models
7070
)
7171

7272
return base_models.APIUser(
73-
is_admin_init=user_props.get("is_admin", False),
73+
is_admin=user_props.get("is_admin", False),
7474
id=user_props.get("id", "some-id") if is_set else None,
7575
access_token=access_token,
7676
first_name=user_props.get("first_name", "John") if is_set else None,

components/renku_data_services/base_api/auth.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
from functools import wraps
77
from typing import Any, Concatenate, ParamSpec, TypeVar, cast
88

9-
from sanic import HTTPResponse, Request
10-
from ulid import ULID
9+
from sanic import Request
1110

1211
from renku_data_services import errors
1312
from renku_data_services.base_models import AnyAPIUser, APIUser, Authenticator

components/renku_data_services/notebooks/api/amalthea_patches/init_containers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async def git_clone_container_v2(
9191
env.append(
9292
{"name": f"{prefix}USER__EMAIL", "value": user.email},
9393
)
94-
full_name = server.user.get_full_name()
94+
full_name = user.get_full_name()
9595
if full_name:
9696
env.append(
9797
{

components/renku_data_services/notebooks/blueprints.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ async def _handler(
916916
args=environment.args,
917917
shmSize="1G",
918918
env=[
919-
SessionEnvItem(name="RENKU_BASE_URL_PATH", value=base_server_url),
920-
SessionEnvItem(name="RENKU_BASE_URL", value=base_server_path),
919+
SessionEnvItem(name="RENKU_BASE_URL_PATH", value=base_server_path),
920+
SessionEnvItem(name="RENKU_BASE_URL", value=base_server_url),
921921
],
922922
),
923923
ingress=Ingress(

components/renku_data_services/notebooks/util/kubernetes_.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727

2828
from renku_data_services.notebooks.crs import Patch, PatchType
2929

30-
from renku_data_services.notebooks.crs import Patch, PatchType
31-
3230

3331
def renku_1_make_server_name(safe_username: str, namespace: str, project: str, branch: str, commit_sha: str) -> str:
3432
"""Form a unique server name for Renku 1.0 sessions.

components/renku_data_services/session/db.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from collections.abc import Callable
66
from contextlib import AbstractAsyncContextManager, nullcontext
77
from datetime import UTC, datetime
8-
from pathlib import PurePosixPath
98
from typing import Any
109

1110
from sqlalchemy import select

test/components/renku_data_services/authz/test_authorization.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
from renku_data_services.namespace.models import Namespace, NamespaceKind
1818
from renku_data_services.project.models import Project
1919

20-
admin_user = APIUser(is_admin_init=True, id="admin-id", access_token="some-token", full_name="admin") # nosec B106
21-
anon_user = APIUser(is_admin_init=False)
22-
regular_user1 = APIUser(is_admin_init=False, id="user1-id", access_token="some-token1", full_name="some-user1") # nosec B106
23-
regular_user2 = APIUser(is_admin_init=False, id="user2-id", access_token="some-token2", full_name="some-user2") # nosec B106
20+
admin_user = APIUser(is_admin=True, id="admin-id", access_token="some-token", full_name="admin") # nosec B106
21+
anon_user = APIUser(is_admin=False)
22+
regular_user1 = APIUser(is_admin=False, id="user1-id", access_token="some-token1", full_name="some-user1") # nosec B106
23+
regular_user2 = APIUser(is_admin=False, id="user2-id", access_token="some-token2", full_name="some-user2") # nosec B106
2424

2525

2626
@pytest_asyncio.fixture

0 commit comments

Comments
 (0)