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

A security context. More...

#include <xentara/security/Context.hpp>

Public Member Functions

internal auto serverCertificate () const -> CertificatePaths
 Gets the paths for the TLS server certificate.
 
auto entitlement (std::string_view name) const -> const Entitlement &
 Gets the entitlement with a specific name.
 
auto entitlement (const utils::core::Uuid &uuid) const -> const Entitlement &
 Gets the entitlement with a specific UUID.
 
auto findEntitlement (std::string_view name) const -> const Entitlement *
 Finds the entitlement with a specific name, returning nullptr on error.
 
auto findEntitlement (const utils::core::Uuid &uuid) const -> const Entitlement *
 Finds the entitlement with a specific UUID, returning nullptr on error.
 
auto oauth2Authenticator () const -> const Oauth2Authenticator &
 Gets the authenticator for Oauth2 compatible JSON web tokens.
 
auto certificateAuthenticator () const -> const CertificateAuthenticator &
 Gets the authenticator for certificate-based user authentication.
 
auto passwordAuthenticator () const -> const PasswordAuthenticator &
 Gets the authenticator for user name/password authentication.
 
auto httpAuthenticator () const -> const HttpAuthenticator &
 Gets the authenticator that should be used for authenticating HTTP requests.
 

Detailed Description

A security context.

This class provides access to security related functions.

Member Function Documentation

◆ certificateAuthenticator()

auto xentara::security::Context::certificateAuthenticator ( ) const -> const CertificateAuthenticator &

Gets the authenticator for certificate-based user authentication.

◆ entitlement() [1/2]

auto xentara::security::Context::entitlement ( const utils::core::Uuid uuid) const -> const Entitlement &

Gets the entitlement with a specific UUID.

Parameters
uuidThe UUID of desired entitlement.
Returns
The corresponding entitlement, or Entitlement::kDeny if no entitlement with the UUID exists.

◆ entitlement() [2/2]

auto xentara::security::Context::entitlement ( std::string_view  name) const -> const Entitlement &

Gets the entitlement with a specific name.

Parameters
nameThe name of desired entitlement, in UTF-8 encoding.
Returns
The corresponding entitlement, or Entitlement::kDeny if no entitlement with the specified name exists.

◆ findEntitlement() [1/2]

auto xentara::security::Context::findEntitlement ( const utils::core::Uuid uuid) const -> const Entitlement *

Finds the entitlement with a specific UUID, returning nullptr on error.

Parameters
uuidThe UUID of desired entitlement.
Returns
A pointer to the corresponding entitlement, or nullptr if no entitlement with the UUID exists.

◆ findEntitlement() [2/2]

auto xentara::security::Context::findEntitlement ( std::string_view  name) const -> const Entitlement *

Finds the entitlement with a specific name, returning nullptr on error.

Parameters
nameThe name of desired entitlement, in UTF-8 encoding.
Returns
A pointer to the corresponding entitlement, or nullptr if no entitlement with the specified name exists.

◆ httpAuthenticator()

auto xentara::security::Context::httpAuthenticator ( ) const -> const HttpAuthenticator &

Gets the authenticator that should be used for authenticating HTTP requests.

◆ oauth2Authenticator()

auto xentara::security::Context::oauth2Authenticator ( ) const -> const Oauth2Authenticator &

Gets the authenticator for Oauth2 compatible JSON web tokens.

◆ passwordAuthenticator()

auto xentara::security::Context::passwordAuthenticator ( ) const -> const PasswordAuthenticator &

Gets the authenticator for user name/password authentication.

◆ serverCertificate()

internal auto xentara::security::Context::serverCertificate ( ) const -> CertificatePaths

Gets the paths for the TLS server certificate.

Returns
The paths of the TLS server certificate and the corresponding private key file
Exceptions
std::runtime_errorOne or both of the files do not exist