yasuki_web.auth#

Classes

AvatarRequest(*, card_id, crop)

CropBox(*, left, top, right, bottom)

DisplayNameUpdate(*, display_name)

RoleCreate(*, name[, description])

RoleUpdate(*, role)

Functions

admin_approve_user(user_id[, admin])

Approve a pending account so it can use the product surfaces.

admin_ban_user(user_id[, admin])

Ban an account: revoke its sessions and tombstone the identity.

admin_create_role(body[, admin])

Define a new role (a short lowercase slug) so it can be assigned.

admin_list_roles([admin])

The defined roles, for the dashboard's role picker.

admin_list_users([admin])

Every account, for the admin dashboard.

admin_set_role(user_id, body[, admin])

Set an account's role to one of the defined roles (422 if it is not defined).

admin_unban_user(user_id[, admin])

Lift a ban so the identity may sign in again.

callback(request)

clear_my_avatar(request[, user])

Clear the avatar, falling the display back to the name's initials.

current_user(request)

The authenticated user, or 401 — the gate for login-required routes.

current_user_optional(request)

The user behind the session cookie, or None — the additive dependency for public routes.

delete_me(request[, user])

Erase the signed-in user's account (decks and sessions included) and clear the cookie.

dev_login(request)

Mint a session without Google, for local development.

dev_login_enabled()

Whether the dev sign-in shortcut is active: opt-in via env and never in production.

login(request)

logout(request)

me([user])

require_admin([user])

The authenticated user if an admin, else 403 — the gate for the admin dashboard.

require_approved([user])

The user if their account is ready for the product (named and approved), else 403.

set_my_avatar(request, body[, user])

Set the signed-in user's avatar to a crop of a chosen card.

update_me(request, body[, user])

Change the signed-in user's display name.

user_for_websocket(websocket)

The user behind the session cookie on a WebSocket handshake, or None.