ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
save_account_request Struct Referencefinal

Request to save an account (create or update). More...

#include <account_protocol.hpp>

Collaboration diagram for save_account_request:
Collaboration graph

Public Member Functions

std::vector< std::byte > serialize () const
 Serialize request to bytes.
 

Static Public Member Functions

static std::expected< save_account_request, ores::utility::serialization::error_code > deserialize (std::span< const std::byte > data)
 Deserialize request from bytes.
 

Public Attributes

boost::uuids::uuid account_id
 
std::string username
 
std::string password
 
std::string totp_secret
 
std::string email
 
std::string recorded_by
 
std::string change_reason_code
 
std::string change_commentary
 

Detailed Description

Request to save an account (create or update).

For creates: leave account_id as nil UUID, provide username and password. For updates: set account_id to the existing account, password is optional.

Note: Administrative privileges are managed through RBAC roles. Use assign_role_request to grant roles after account creation.

Member Function Documentation

◆ serialize()

std::vector< std::byte > serialize ( ) const

Serialize request to bytes.

Format:

  • 16 bytes: account_id (UUID, nil for create)
  • 2 bytes: username length
  • N bytes: username (UTF-8)
  • 2 bytes: password length
  • N bytes: password (UTF-8)
  • 2 bytes: totp_secret length
  • N bytes: totp_secret (UTF-8)
  • 2 bytes: email length
  • N bytes: email (UTF-8)
  • 2 bytes: recorded_by length
  • N bytes: recorded_by (UTF-8)
  • 2 bytes: change_reason_code length
  • N bytes: change_reason_code (UTF-8)
  • 2 bytes: change_commentary length
  • N bytes: change_commentary (UTF-8)