Skip to content

Commit

Permalink
feat: use the amalthea session cache
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski committed Oct 4, 2024
1 parent f74888e commit 749810e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion components/renku_data_services/authn/dummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def authenticate(self, access_token: str, request: Request) -> base_models
)

return base_models.APIUser(
is_admin_init=user_props.get("is_admin", False),
is_admin=user_props.get("is_admin", False),
id=user_props.get("id", "some-id") if is_set else None,
access_token=access_token,
first_name=user_props.get("first_name", "John") if is_set else None,
Expand Down
3 changes: 1 addition & 2 deletions components/renku_data_services/base_api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from functools import wraps
from typing import Any, Concatenate, ParamSpec, TypeVar, cast

from sanic import HTTPResponse, Request
from ulid import ULID
from sanic import Request

from renku_data_services import errors
from renku_data_services.base_models import AnyAPIUser, APIUser, Authenticator
Expand Down
2 changes: 0 additions & 2 deletions components/renku_data_services/notebooks/util/kubernetes_.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

from renku_data_services.notebooks.crs import Patch, PatchType

from renku_data_services.notebooks.crs import Patch, PatchType


def renku_1_make_server_name(safe_username: str, namespace: str, project: str, branch: str, commit_sha: str) -> str:
"""Form a unique server name for Renku 1.0 sessions.
Expand Down
1 change: 0 additions & 1 deletion components/renku_data_services/session/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from collections.abc import Callable
from contextlib import AbstractAsyncContextManager, nullcontext
from datetime import UTC, datetime
from pathlib import PurePosixPath
from typing import Any

from sqlalchemy import select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
from renku_data_services.namespace.models import Namespace, NamespaceKind
from renku_data_services.project.models import Project

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


@pytest_asyncio.fixture
Expand Down

0 comments on commit 749810e

Please sign in to comment.