OpenTTD Source 20260311-master-g511d3794ce
NetworkAuthenticationDefaultPasswordProvider Class Reference

Default implementation of the password provider. More...

#include <network_crypto.h>

Inheritance diagram for NetworkAuthenticationDefaultPasswordProvider:
NetworkAuthenticationPasswordProvider

Public Member Functions

 NetworkAuthenticationDefaultPasswordProvider (const std::string &password)
 Create the provider with the pointer to the password that is to be used.
std::string_view GetPassword () const override
 Callback to return the password where to validate against.
Public Member Functions inherited from NetworkAuthenticationPasswordProvider
virtual ~NetworkAuthenticationPasswordProvider ()=default
 Ensure the destructor of the sub classes are called as well.

Private Attributes

const std::string * password
 The password to check against.

Detailed Description

Default implementation of the password provider.

Definition at line 127 of file network_crypto.h.

Constructor & Destructor Documentation

◆ NetworkAuthenticationDefaultPasswordProvider()

NetworkAuthenticationDefaultPasswordProvider::NetworkAuthenticationDefaultPasswordProvider ( const std::string & password)
inline

Create the provider with the pointer to the password that is to be used.

A pointer, so this can handle situations where the password gets changed over time.

Parameters
passwordThe reference to the configured password.

Definition at line 136 of file network_crypto.h.

References password.

Member Function Documentation

◆ GetPassword()

std::string_view NetworkAuthenticationDefaultPasswordProvider::GetPassword ( ) const
inlineoverridevirtual

Callback to return the password where to validate against.

Returns
std::string_view of the current password; an empty view means no password check will be performed.

Implements NetworkAuthenticationPasswordProvider.

Definition at line 138 of file network_crypto.h.

Field Documentation

◆ password

const std::string* NetworkAuthenticationDefaultPasswordProvider::password
private

The password to check against.

Definition at line 129 of file network_crypto.h.

Referenced by NetworkAuthenticationDefaultPasswordProvider().


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