Cavoke  1.1.0
A Platform for creating and hosting multiplayer turn-based board games
Loading...
Searching...
No Matches
AuthFilter Class Reference

#include <AuthFilter.h>

Inheritance diagram for AuthFilter:
[legend]

Classes

struct  AuthConfig
 

Public Member Functions

void doFilter (const HttpRequestPtr &req, FilterCallback &&fcb, FilterChainCallback &&fccb) override
 

Static Public Member Functions

static std::string get_user_id (const HttpRequestPtr &)
 Acquires user_id parsed during AuthFilter's execution.
 

Detailed Description

Provides an authentication interceptor that checks a bearer token using a public key given in the configuration file.

If authenticated, makes user_id available to controllers through AuthFilter::get_user_id(req).

If no configuration for auth is found, allows all requests and acquires user_id from query param with the same name. A corresponding warning about running in the insecure mode will be displayed in the logs.

Definition at line 23 of file AuthFilter.h.

Constructor & Destructor Documentation

◆ AuthFilter()

AuthFilter::AuthFilter ( )

Definition at line 5 of file AuthFilter.cc.

Member Function Documentation

◆ doFilter()

void AuthFilter::doFilter ( const HttpRequestPtr &  req,
FilterCallback &&  fcb,
FilterChainCallback &&  fccb 
)
override

Definition at line 32 of file AuthFilter.cc.

◆ get_user_id()

std::string AuthFilter::get_user_id ( const HttpRequestPtr &  req)
static

Acquires user_id parsed during AuthFilter's execution.

Definition at line 82 of file AuthFilter.cc.


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