Turi Create  4.0
cppipc::authentication_base Class Referenceabstract

#include <core/system/cppipc/common/authentication_base.hpp>

Public Member Functions

virtual void apply_auth (call_message &msg)=0
 
virtual void apply_auth (reply_message &msg)=0
 
virtual bool validate_auth (call_message &msg)=0
 
virtual bool validate_auth (reply_message &msg)=0
 

Detailed Description

Base class for all authentication method implementations.

The class implements a few basic functions to attach and validate messages sent between the client and the server. Messages sent from the client to the server are call_message objects. Messages sent from the server to the client (in response to a call message) are reply_message objects.

authentication_base::apply_auth(call_message& msg) is called on the client side to attach authentication information to the message. When the server receives the message, authentication_base::validate_auth(call_message& msg) is called on the server side to validate the message. If this function returns false, the server discards the message. The server then replies with a reply_message and the function authentication_base::apply_auth(reply_message& msg) is called on the server side to attach authentication information to the message. When the client receives the message, authentication_base::validate_auth(reply_message& msg) is called on the client side to validate the message. If this function returns false, the function call is marked as failed.

All of the implemented functions must be reentrant, and must not assume synchronicity. (i.e. apply_auth can be called on the client side many times in succession).

Finally, authentication methods should be designed to be "stackable" with other authentication methods. i.e. I should be able to apply two different types of authentication methods on top of each other.

Definition at line 43 of file authentication_base.hpp.

Member Function Documentation

◆ apply_auth() [1/2]

virtual void cppipc::authentication_base::apply_auth ( call_message msg)
pure virtual

Attaches the authentication information to a message sent from the client to the server. This function must be reentrant.

Implemented in cppipc::authentication_token_method.

◆ apply_auth() [2/2]

virtual void cppipc::authentication_base::apply_auth ( reply_message msg)
pure virtual

Attaches the authentication information to a message sent from the server to the client. This function must be reentrant.

Implemented in cppipc::authentication_token_method.

◆ validate_auth() [1/2]

virtual bool cppipc::authentication_base::validate_auth ( call_message msg)
pure virtual

Validates a message received on the server from a client. This function must be reentrant. If the function returns true, the message is good. Otherwise, the message is bad.

Implemented in cppipc::authentication_token_method.

◆ validate_auth() [2/2]

virtual bool cppipc::authentication_base::validate_auth ( reply_message msg)
pure virtual

Validates a message received on the client from a server. This function must be reentrant. If the function returns true, the message is good. Otherwise, the message is bad.

Implemented in cppipc::authentication_token_method.


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