xentara-plugin v2.1
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::security Namespace Reference

Security and authentication related functionality More...

Classes

class  Authorization
 A authorization that contains the entitlements of an authenticated user. More...
 
class  CertificateAuthenticator
 An authenticator that uses a user certificates. More...
 
class  CertificatePaths
 Paths to the files containing a TLS certificate and the associated private key. More...
 
class  Context
 A security context. More...
 
class  CorsOriginPattern
 A pattern used to match HTTP request origins for CORS (Cross-Origin Resource Sharing) More...
 
class  Entitlement
 An entitlement that can be used to restrict access to a protected resource. More...
 
class  HttpAuthenticator
 An authenticator for authenticating HTTP requests. More...
 
class  HttpConfig
 Server-side authentication configuration for an HTTP based service. More...
 
struct  NoFieldNameTag
 Type used to select overloads of HttpAuthenticator that do not include the header field name. More...
 
class  Oauth2Authenticator
 An authenticator that uses OAuth 2.0 compatible JSON web tokens. More...
 
class  Oauth2Scope
 An OAuth 2.0 scope, consisting of a list of scope strings. More...
 
class  PasswordAuthenticator
 An authenticator that uses user name and password. More...
 

Enumerations

enum class  DigestType { Sha256 , Sha384 , Sha512 }
 Message digest types. More...
 
enum class  Error {
  NoError , AccessDenied , MissingAuthorizationHeader , DuplicateAuthorizationHeader ,
  DuplicateOriginHeader , OriginNotAllowed
}
 Security error codes. More...
 

Functions

template<utils::tools::CharType Char>
auto toBasicString (DigestType digestType) -> std::basic_string_view< Char >
 Converts a digest type to a string.
 
auto toString (DigestType digestType) -> std::string_view
 Converts a digest type to a string of type char
 
auto toWString (DigestType digestType) -> std::wstring_view
 Converts a digest type to a string of type wchar_t
 
auto toU8String (DigestType digestType) -> std::u8string_view
 Converts a digest type to a string of type char8_t
 
auto toU16String (DigestType digestType) -> std::u16string_view
 Converts a digest type to a string of type char16_t
 
auto toU32String (DigestType digestType) -> std::u32string_view
 Converts a number to a string of type char32_t
 
auto operator<< (std::ostream &stream, DigestType digestType) -> std::ostream &
 Stream insertion operator for qualities.
 
auto make_error_code (Error errorCode) noexcept -> std::error_code
 Creates an error code object from an error code of type [Error].
 
auto httpResponseCode (Error errorCode) noexcept -> std::string_view
 Gets the appropriate HTTP response code for an error code.
 
auto httpResponseCode (std::error_code errorCode) noexcept -> std::string_view
 Gets the appropriate HTTP response code for an arbitrary error code.
 

Detailed Description

Security and authentication related functionality

This namespace contains functionality for authenticating clients, checking access rights of clients, and other security related functionality.

Enumeration Type Documentation

◆ DigestType

enum class xentara::security::DigestType
strong

Message digest types.

Include file
#include <xentara/security/DigestType.hpp>
Enumerator
Sha256 

A digest generated using the SHA-256 hash algorithm.

Sha384 

A digest generated using the SHA-384 hash algorithm.

Sha512 

A digest generated using the SHA-512 hash algorithm.

◆ Error

enum class xentara::security::Error
strong

Security error codes.

Enumerator
NoError 

No error occurred.

AccessDenied 

Access to a protected resource was Denied.

MissingAuthorizationHeader 

An HTTP request contained no “Authorization” header field.

DuplicateAuthorizationHeader 

An HTTP request contained more than one “Authorization” header field.

DuplicateOriginHeader 

An HTTP request contained more than one “Origin” header field.

OriginNotAllowed 

The origin of an HTTP request did not match any of the configured allowed origins.

Function Documentation

◆ httpResponseCode() [1/2]

auto xentara::security::httpResponseCode ( Error  errorCode) -> std::string_view
noexcept

Gets the appropriate HTTP response code for an error code.

◆ httpResponseCode() [2/2]

auto xentara::security::httpResponseCode ( std::error_code  errorCode) -> std::string_view
noexcept

Gets the appropriate HTTP response code for an arbitrary error code.

◆ make_error_code()

auto xentara::security::make_error_code ( Error  errorCode) -> std::error_code
noexcept

Creates an error code object from an error code of type [Error].

◆ operator<<()

auto xentara::security::operator<< ( std::ostream &  stream,
DigestType  digestType 
) -> std::ostream &

Stream insertion operator for qualities.

Include file
#include <xentara/security/DigestType.hpp>
Parameters
streamThe stream
digestTypeThe digest type
Returns
The stream

◆ toBasicString()

template<utils::tools::CharType Char>
auto xentara::security::toBasicString ( DigestType  digestType) -> std::basic_string_view<Char>

Converts a digest type to a string.

Include file
#include <xentara/security/DigestType.hpp>
Parameters
digestTypeThe digest type
Returns
A string containing the digest type as a UTF-8 text

◆ toString()

auto xentara::security::toString ( DigestType  digestType) -> std::string_view

Converts a digest type to a string of type char

Include file
#include <xentara/security/DigestType.hpp>
Parameters
digestTypeThe digest type
Returns
A string containing the digest type

◆ toU16String()

auto xentara::security::toU16String ( DigestType  digestType) -> std::u16string_view

Converts a digest type to a string of type char16_t

Include file
#include <xentara/security/DigestType.hpp>
Parameters
digestTypeThe digest type
Returns
A string containing the digest type

◆ toU32String()

auto xentara::security::toU32String ( DigestType  digestType) -> std::u32string_view

Converts a number to a string of type char32_t

Include file
#include <xentara/security/DigestType.hpp>
Parameters
digestTypeThe digest type
Returns
A string containing the digest type

◆ toU8String()

auto xentara::security::toU8String ( DigestType  digestType) -> std::u8string_view

Converts a digest type to a string of type char8_t

Include file
#include <xentara/security/DigestType.hpp>
Parameters
digestTypeThe digest type
Returns
A string containing the digest type

◆ toWString()

auto xentara::security::toWString ( DigestType  digestType) -> std::wstring_view

Converts a digest type to a string of type wchar_t

Include file
#include <xentara/security/DigestType.hpp>
Parameters
digestTypeThe digest type
Returns
A string containing the digest type