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

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  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 to 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 }
 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.
 
template auto toBasicString< char > (DigestType digestType) -> std::basic_string_view< char >
 
template auto toBasicString< wchar_t > (DigestType digestType) -> std::basic_string_view< wchar_t >
 
template auto toBasicString< char8_t > (DigestType digestType) -> std::basic_string_view< char8_t >
 
template auto toBasicString< char16_t > (DigestType digestType) -> std::basic_string_view< char16_t >
 
template auto toBasicString< char32_t > (DigestType digestType) -> std::basic_string_view< char32_t >
 
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.
 

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.

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.

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

◆ toBasicString()

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

Converts a digest type to a string.

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

◆ toBasicString< char >()

template auto xentara::security::toBasicString< char > ( DigestType  digestType) -> std::basic_string_view< char >
extern

◆ toBasicString< char16_t >()

template auto xentara::security::toBasicString< char16_t > ( DigestType  digestType) -> std::basic_string_view< char16_t >
extern

◆ toBasicString< char32_t >()

template auto xentara::security::toBasicString< char32_t > ( DigestType  digestType) -> std::basic_string_view< char32_t >
extern

◆ toBasicString< char8_t >()

template auto xentara::security::toBasicString< char8_t > ( DigestType  digestType) -> std::basic_string_view< char8_t >
extern

◆ toBasicString< wchar_t >()

template auto xentara::security::toBasicString< wchar_t > ( DigestType  digestType) -> std::basic_string_view< wchar_t >
extern

◆ toString()

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

Converts a digest type to a string of type char

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

◆ toU16String()

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

Converts a digest type to a string of type char16_t

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

◆ toU32String()

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

Converts a number to a string of type char32_t

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

◆ toU8String()

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

Converts a digest type to a string of type char8_t

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

◆ toWString()

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

Converts a digest type to a string of type wchar_t

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