Web framework C++  2.0.0
Simple web framework on c++ designed to easily create web pages, etc
Public Member Functions | List of all members
AuthStrategy Class Referenceabstract

Interface for auth strategy template. More...

#include <auth_strategy.h>

Inheritance diagram for AuthStrategy:
Inheritance graph
Collaboration diagram for AuthStrategy:
Collaboration graph

Public Member Functions

virtual ~AuthStrategy ()=default
 
virtual std::string getSerializedValue (Headers *headers)=0
 
virtual bool checkHeadersToParse (Headers *headers)=0
 
virtual void serializeAndSetValueToResponse (std::string &value)=0
 

Detailed Description

Interface for auth strategy template.

This is abstract class for authentication strategies. You can create your own strategy, which inherits AuthStrategy class and implements all methods below. CookieAuth and JwtAuth are defined in this framework.

Constructor & Destructor Documentation

virtual AuthStrategy::~AuthStrategy ( )
virtualdefault

virtual destructor

Member Function Documentation

virtual bool AuthStrategy::checkHeadersToParse ( Headers headers)
pure virtual

Check, if this strategy could be executed with such request headers

Parameters
headerscurrent request headers
Returns
true, if there are some data in headers, which this strategy could proceed, false otherwise

Implemented in CookieAuth, and JwtAuth.

virtual std::string AuthStrategy::getSerializedValue ( Headers headers)
pure virtual

Parse headers to get serialized user credentials

Parameters
headerscurrent request headers
Returns
serialized user in string

Implemented in CookieAuth, and JwtAuth.

virtual void AuthStrategy::serializeAndSetValueToResponse ( std::string &  value)
pure virtual

Set to current response user credentials

Parameters
valueserialized user

Implemented in CookieAuth, and JwtAuth.


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