Security & 2FA

Password, account TTL, password recovery, and 2FA commands.

Security & 2FA Commands

Password, account TTL, password recovery, and 2FA commands.

Handler group source

  • Handler module: backend/tg_client/dialogs/commands/handlers/security.py
  • Registered commands: 11
  • Registry integration: backend/tg_client/dialogs/commands/registry.py

Command index

Command Handler Service / callable Success event(s) Notes
`get_password_state` handle_security_commands security_command_service.get_password_state get_password_state single logical response
`get_account_ttl` handle_security_commands security_command_service.get_account_ttl get_account_ttl single logical response
`set_account_ttl` handle_security_commands security_command_service.set_account_ttl set_account_ttl Success does not return the raw TDLib result. The handler emits {days}.
`request_password_recovery` handle_security_commands security_command_service.request_password_recovery request_password_recovery single logical response
`check_password_recovery_code` handle_security_commands security_command_service.check_password_recovery_code check_password_recovery_code Success does not return the raw TDLib result. The handler emits {recovery_code}.
`recover_password` handle_security_commands security_command_service.recover_password recover_password single logical response
`verify_2fa_password` handle_security_commands security_command_service.verify_2fa_password verify_2fa_password single logical response
`change_2fa_password` handle_security_commands security_command_service.change_2fa_password change_2fa_password single logical response
`disable_2fa_password` handle_security_commands security_command_service.disable_2fa_password disable_2fa_password single logical response
`change_2fa_recovery_email` handle_security_commands security_command_service.change_2fa_recovery_email change_2fa_recovery_email single logical response
`get_transfer_ownership_state` handle_security_commands security_command_service.get_transfer_ownership_state get_transfer_ownership_state single logical response

Group conventions

  • Incoming client requests use the WebSocket action field and are routed into the owner runtime via publish_command().
  • Outbound success/error payloads are wrapped into chat_update live events.
  • ctx.send_response() means one logical success event plus a conventional <command>_error event on failure.
  • Manual ctx.send() branches indicate streaming or custom event emission; these commands are documented explicitly below.
  • Request field types and required flags are inferred from handler/service code because there is no formal request schema object for every command.

Command: get_password_state

Summary

Get password state.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 22).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::get_password_state.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "get_password_state",
  "userbot_id": 1
}

Parameters

Field Type Required Default Description
This command does not require extra payload fields beyond action and userbot_id.

Response variants

  • Success event(s): get_password_state.
  • Error event(s): get_password_state_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Errors

Error Type/Code When happens Notes
TDLib / service error string Raw API call fails or the service returns a transport-shaped error Forwarded from TdlibBaseClient.tg_call() or the service layer.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes get_password_state.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::get_password_state.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_account_ttl, set_account_ttl, request_password_recovery, check_password_recovery_code, recover_password, verify_2fa_password, change_2fa_password, disable_2fa_password, change_2fa_recovery_email, get_transfer_ownership_state.

Command: get_account_ttl

Summary

Get account ttl.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 27).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::get_account_ttl.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "get_account_ttl",
  "userbot_id": 1
}

Parameters

Field Type Required Default Description
This command does not require extra payload fields beyond action and userbot_id.

Response variants

  • Success event(s): get_account_ttl.
  • Error event(s): get_account_ttl_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Errors

Error Type/Code When happens Notes
TDLib / service error string Raw API call fails or the service returns a transport-shaped error Forwarded from TdlibBaseClient.tg_call() or the service layer.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes get_account_ttl.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::get_account_ttl.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_password_state, set_account_ttl, request_password_recovery, check_password_recovery_code, recover_password, verify_2fa_password, change_2fa_password, disable_2fa_password, change_2fa_recovery_email, get_transfer_ownership_state.

Command: set_account_ttl

Summary

Set account inactivity TTL and echo the requested number of days on success.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 32).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::set_account_ttl.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "set_account_ttl",
  "userbot_id": 1,
  "days": 180
}

Parameters

Field Type Required Default Description
days integer required Derived from handler payload access in current code.

Response variants

  • Success event(s): set_account_ttl.
  • Error event(s): set_account_ttl_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Notes: Success does not return the raw TDLib result. The handler emits {days}.

Errors

Error Type/Code When happens Notes
days is required string Service-side validation or branch guard Returned as the error field of the error event.
days must be between 30 and 730 string Validation of TDLib-style input payload Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes set_account_ttl.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::set_account_ttl.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_password_state, get_account_ttl, request_password_recovery, check_password_recovery_code, recover_password, verify_2fa_password, change_2fa_password, disable_2fa_password, change_2fa_recovery_email, get_transfer_ownership_state.

Command: request_password_recovery

Summary

Request password recovery.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 41).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::request_password_recovery.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "request_password_recovery",
  "userbot_id": 1
}

Parameters

Field Type Required Default Description
This command does not require extra payload fields beyond action and userbot_id.

Response variants

  • Success event(s): request_password_recovery.
  • Error event(s): request_password_recovery_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Errors

Error Type/Code When happens Notes
TDLib / service error string Raw API call fails or the service returns a transport-shaped error Forwarded from TdlibBaseClient.tg_call() or the service layer.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes request_password_recovery.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::request_password_recovery.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_password_state, get_account_ttl, set_account_ttl, check_password_recovery_code, recover_password, verify_2fa_password, change_2fa_password, disable_2fa_password, change_2fa_recovery_email, get_transfer_ownership_state.

Command: check_password_recovery_code

Summary

Validate a password recovery code and echo the checked code on success.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 46).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::check_password_recovery_code.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "check_password_recovery_code",
  "userbot_id": 1,
  "recovery_code": "123456"
}

Parameters

Field Type Required Default Description
recovery_code string required Derived from handler payload access in current code.

Response variants

  • Success event(s): check_password_recovery_code.
  • Error event(s): check_password_recovery_code_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Notes: Success does not return the raw TDLib result. The handler emits {recovery_code}.

Errors

Error Type/Code When happens Notes
recovery_code is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes check_password_recovery_code.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::check_password_recovery_code.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_password_state, get_account_ttl, set_account_ttl, request_password_recovery, recover_password, verify_2fa_password, change_2fa_password, disable_2fa_password, change_2fa_recovery_email, get_transfer_ownership_state.

Command: recover_password

Summary

Recover password.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 58).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::recover_password.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "recover_password",
  "userbot_id": 1,
  "recovery_code": "123456",
  "new_password": "secret-password",
  "new_hint": "value"
}

Parameters

Field Type Required Default Description
recovery_code string required Derived from handler payload access in current code.
new_password string optional Derived from handler payload access in current code.
new_hint unknown optional Derived from handler payload access in current code.

Response variants

  • Success event(s): recover_password.
  • Error event(s): recover_password_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Errors

Error Type/Code When happens Notes
recovery_code is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes recover_password.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::recover_password.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_password_state, get_account_ttl, set_account_ttl, request_password_recovery, check_password_recovery_code, verify_2fa_password, change_2fa_password, disable_2fa_password, change_2fa_recovery_email, get_transfer_ownership_state.

Command: verify_2fa_password

Summary

Verify 2FA password.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 67).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::verify_2fa_password.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "verify_2fa_password",
  "userbot_id": 1,
  "password": "secret-password"
}

Parameters

Field Type Required Default Description
password string required Derived from handler payload access in current code.

Response variants

  • Success event(s): verify_2fa_password.
  • Error event(s): verify_2fa_password_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Errors

Error Type/Code When happens Notes
password is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes verify_2fa_password.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::verify_2fa_password.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_password_state, get_account_ttl, set_account_ttl, request_password_recovery, check_password_recovery_code, recover_password, change_2fa_password, disable_2fa_password, change_2fa_recovery_email, get_transfer_ownership_state.

Command: change_2fa_password

Summary

Change 2FA password.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 74).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::change_2fa_password.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "change_2fa_password",
  "userbot_id": 1,
  "current_password": "secret-password",
  "new_password": "secret-password",
  "new_hint": "value",
  "new_recovery_email_address": "owner@example.com"
}

Parameters

Field Type Required Default Description
current_password string required Derived from handler payload access in current code.
new_password string optional Derived from handler payload access in current code.
new_hint unknown optional Derived from handler payload access in current code.
set_recovery_email_address boolean optional false Derived from handler payload access in current code.
new_recovery_email_address string optional Derived from handler payload access in current code.

Response variants

  • Success event(s): change_2fa_password.
  • Error event(s): change_2fa_password_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Errors

Error Type/Code When happens Notes
current_password is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes change_2fa_password.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::change_2fa_password.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_password_state, get_account_ttl, set_account_ttl, request_password_recovery, check_password_recovery_code, recover_password, verify_2fa_password, disable_2fa_password, change_2fa_recovery_email, get_transfer_ownership_state.

Command: disable_2fa_password

Summary

Disable 2FA password.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 85).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::disable_2fa_password.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "disable_2fa_password",
  "userbot_id": 1,
  "current_password": "secret-password"
}

Parameters

Field Type Required Default Description
current_password string required Derived from handler payload access in current code.

Response variants

  • Success event(s): disable_2fa_password.
  • Error event(s): disable_2fa_password_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Errors

Error Type/Code When happens Notes
current_password is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes disable_2fa_password.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::disable_2fa_password.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_password_state, get_account_ttl, set_account_ttl, request_password_recovery, check_password_recovery_code, recover_password, verify_2fa_password, change_2fa_password, change_2fa_recovery_email, get_transfer_ownership_state.

Command: change_2fa_recovery_email

Summary

Change 2FA recovery email.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 92).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::change_2fa_recovery_email.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "change_2fa_recovery_email",
  "userbot_id": 1,
  "current_password": "secret-password",
  "new_recovery_email_address": "owner@example.com"
}

Parameters

Field Type Required Default Description
current_password string required Derived from handler payload access in current code.
new_recovery_email_address string required Derived from handler payload access in current code.

Response variants

  • Success event(s): change_2fa_recovery_email.
  • Error event(s): change_2fa_recovery_email_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Errors

Error Type/Code When happens Notes
current_password is required string Service-side validation or branch guard Returned as the error field of the error event.
new_recovery_email_address is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes change_2fa_recovery_email.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::change_2fa_recovery_email.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_password_state, get_account_ttl, set_account_ttl, request_password_recovery, check_password_recovery_code, recover_password, verify_2fa_password, change_2fa_password, disable_2fa_password, get_transfer_ownership_state.

Command: get_transfer_ownership_state

Summary

Get transfer ownership state.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/security.py::handle_security_commands (branch starts near line 100).
  • Service: backend/tg_client/dialogs/tdlib/services/security_command_service.py::get_transfer_ownership_state.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/security.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Request

Structure

{
  "action": "get_transfer_ownership_state",
  "userbot_id": 1
}

Parameters

Field Type Required Default Description
This command does not require extra payload fields beyond action and userbot_id.

Response variants

  • Success event(s): get_transfer_ownership_state.
  • Error event(s): get_transfer_ownership_state_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.

Errors

Error Type/Code When happens Notes
TDLib / service error string Raw API call fails or the service returns a transport-shaped error Forwarded from TdlibBaseClient.tg_call() or the service layer.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_security_commands processes get_transfer_ownership_state.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/security_command_service.py::get_transfer_ownership_state.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/security.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/security_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: get_password_state, get_account_ttl, set_account_ttl, request_password_recovery, check_password_recovery_code, recover_password, verify_2fa_password, change_2fa_password, disable_2fa_password, change_2fa_recovery_email.