lablup / lablup/backend.ai

Migrate update_password_no_auth handler to v2 anonymous client

Open
#9,593 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

Replace the per-request v1 anonymous APISession in update_password_no_auth handler with the persistent v2 BackendAIAnonymousClient registered on the app.

Implementation:

- Replace the v1 block (APIConfig + APISession context manager + api_session.Auth.update_password_no_auth()) with app["anon_client"].update_password_no_auth() using UpdatePasswordNoAuthRequest DTO.

- Pass forwarding headers via build_forwarding_headers() + extra_headers parameter.

- Extract password_changed_at from the typed response.

- Add aiohttp.ClientError to the network error catch block, since the v2 client does not wrap aiohttp errors into BackendClientError.

This naturally fixes BA-1146 (400 "Malformed body") because the v2 client sends plain JSON instead of using v1's _put_secure_body() encryption.

Files:

- src/ai/backend/web/server.py

Depends on:

- BA-4837: Add extra_headers support to v2 BackendAIAnonymousClient

- BA-4838: Register persistent v2 anonymous client on webserver app

Story points: 1

JIRA Issue: BA-4839

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.