Leosac  0.8.0
Open Source Access Control
Leosac::Module::WebSockAPI::PasswordChange Class Reference

Change the password of a give user, generally self. More...

#include <PasswordChange.hpp>

+ Inheritance diagram for Leosac::Module::WebSockAPI::PasswordChange:
+ Collaboration diagram for Leosac::Module::WebSockAPI::PasswordChange:

Public Member Functions

 PasswordChange (RequestContext ctx)
 
- Public Member Functions inherited from Leosac::Module::WebSockAPI::MethodHandler
 MethodHandler (RequestContext ctx)
 
virtual ~MethodHandler ()=default
 
json process (const ClientMessage &msg)
 The public process() method. More...
 
UserSecurityContextsecurity_context ()
 
ExecutionContext exec_context ()
 Returns a representation of the execution context of this request. More...
 

Static Public Member Functions

static MethodHandlerUPtr create (RequestContext)
 
- Static Public Member Functions inherited from Leosac::Module::WebSockAPI::MethodHandler
static MethodHandlerUPtr create (RequestContext)
 An example method that should be implemented in all subclasses. More...
 

Protected Member Functions

std::vector< ActionActionParamrequired_permission (const json &req) const override
 Return a list of "Action" / "ActionParam" that must pass before the request is processed. More...
 

Private Member Functions

virtual json process_impl (const json &req) override
 The API method implementation. More...
 

Additional Inherited Members

- Public Types inherited from Leosac::Module::WebSockAPI::MethodHandler
using Factory = MethodHandlerUPtr(*)(RequestContext)
 
- Protected Attributes inherited from Leosac::Module::WebSockAPI::MethodHandler
RequestContext ctx_
 

Detailed Description

Change the password of a give user, generally self.

Request:

  • user_id: The user_id of the user we want to change the password of. This attribute is required.
  • current_password: Cleartext copy of the currently in use password. Note that this parameter is only required when changing our own password.
  • new_password: The new password in cleartext. Required.

Response:

  • Empty response. Refer to the global status code for error detection.

Definition at line 45 of file PasswordChange.hpp.

Constructor & Destructor Documentation

◆ PasswordChange()

PasswordChange::PasswordChange ( RequestContext  ctx)

Definition at line 35 of file PasswordChange.cpp.

Member Function Documentation

◆ create()

MethodHandlerUPtr PasswordChange::create ( RequestContext  ctx)
static

Definition at line 40 of file PasswordChange.cpp.

◆ process_impl()

json PasswordChange::process_impl ( const json req)
overrideprivatevirtual

The API method implementation.

Returns
A json object that will be assigned to the content key in the JSON message sent to the client.

Implements Leosac::Module::WebSockAPI::MethodHandler.

Definition at line 45 of file PasswordChange.cpp.

◆ required_permission()

std::vector< ActionActionParam > PasswordChange::required_permission ( const json req) const
overrideprotectedvirtual

Return a list of "Action" / "ActionParam" that must pass before the request is processed.

Implements Leosac::Module::WebSockAPI::MethodHandler.

Definition at line 88 of file PasswordChange.cpp.


The documentation for this class was generated from the following files: