CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
Token.h File Reference
#include <uWebSockets/HttpContext.h>
#include <string>
Include dependency graph for Token.h:
This graph shows which files directly or indirectly include this file:

Functions

std::string NewAuthToken ()
 Create a new authentication token.
 
bool ValidateAuthToken (uWS::HttpRequest *http_request, const std::string &required_token)
 Validate an HTTP request.
 

Detailed Description

Utilities for working with authentication tokens.

Function Documentation

◆ NewAuthToken()

std::string NewAuthToken ( )

Create a new authentication token.

Returns
A new random token.
Here is the caller graph for this function:

◆ ValidateAuthToken()

bool ValidateAuthToken ( uWS::HttpRequest *  http_request,
const std::string &  required_token 
)

Validate an HTTP request.

Parameters
http_requestThe HTTP request to validate.
required_tokenThe token to use for authentication.
Returns
Whether the request contains the required authentication token.
Here is the call graph for this function:
Here is the caller graph for this function: