Wolframe, 0.0.3

Execution context passed to functions for referencing resources and to define authorization dependend processing. More...

#include <execContext.hpp>

Public Types

enum  BasicAuthorizationFunction { CONNECT, PASSWD }
 Hardcoded basic authorization function enumeration. More...
 

Public Member Functions

 ExecContext ()
 Default Constructor. More...
 
 ExecContext (const ProcessorProviderInterface *p, const AAAA::AAAAproviderInterface *a)
 Constructor. More...
 
const ProcessorProviderInterfaceprovider () const
 Get the processor provider interface. More...
 
const AAAA::Useruser () const
 Get the the user instance reference. More...
 
void setUser (AAAA::User *u)
 Set the user instance. More...
 
const AAAA::Authorizerauthorizer () const
 Get the authorization instance interface. More...
 
void setAuthorizer (const AAAA::Authorizer *a)
 Set the authorization instance interface. More...
 
unsigned int defaultTimeout () const
 Get the default timeout for read operations in seconds. More...
 
void setDefaultTimeout (unsigned int timeout_sec_)
 Set the default timeout for read operations in seconds (0=forever) More...
 
const char * socketIdentifier () const
 Get the socket identifier for authorization checks. More...
 
const net::RemoteEndpointremoteEndpoint () const
 Get the remote endpoint for authorization checks. More...
 
const net::LocalEndpointlocalEndpoint () const
 Get the local endpoint for authorization checks. More...
 
void setConnectionData (const net::RemoteEndpointR &remoteEndpoint_, const net::LocalEndpointR &localEndpoint_)
 Set the socket identifier for authorization checks. More...
 
bool hasCapability (const std::string &c) const
 Ask for a capability for this execution context. More...
 
AAAA::Authenticatorauthenticator (const net::RemoteEndpoint &client) const
 Get an authenticator. More...
 
AAAA::PasswordChangerpasswordChanger (const net::RemoteEndpoint &client) const
 Get a password changer. More...
 
bool checkAuthorization (const std::string &funcname, const std::string &resource, std::string &errmsg, bool allowIfNotExists=false)
 Checks if a function tagged with AUTHORIZE( funcname, resource) is allowed to be executed. More...
 
bool checkAuthorization (BasicAuthorizationFunction f)
 Checks authorization for a basic function. More...
 
db::Transactiontransaction (const std::string &name)
 Create a new transaction object. More...
 
void push_database (const std::string &dbname)
 Declare the database 'dbname' as the current transaction database. More...
 
void pop_database ()
 Restore the previous current transaction database. More...
 

Static Public Member Functions

static const char * basicAuthorizationFunctionName (BasicAuthorizationFunction n)
 Get the name of a basic function. More...
 

Private Member Functions

 ExecContext (const ExecContext &)
 
void operator= (const ExecContext &)
 

Private Attributes

const ProcessorProviderInterfacem_provider
 processor provider interface More...
 
types::SecureReference
< AAAA::User
m_user
 user instance More...
 
const AAAA::Authorizerm_authorizer
 instance to query for execution permission based on login data More...
 
const AAAA::AAAAproviderInterfacem_aaaaProvider
 instance to query for an authenticator More...
 
unsigned int m_default_timeout
 default timeout More...
 
net::RemoteEndpointR m_remoteEndpoint
 remote end point of the connection More...
 
net::LocalEndpointR m_localEndpoint
 local end point of the connection More...
 
std::vector< std::string > m_dbstack
 stack for implementing current database as scope More...
 

Detailed Description

Execution context passed to functions for referencing resources and to define authorization dependend processing.

Member Enumeration Documentation

Hardcoded basic authorization function enumeration.

Enumerator
CONNECT 
PASSWD 

Constructor & Destructor Documentation

_Wolframe::proc::ExecContext::ExecContext ( )
inline

Default Constructor.

_Wolframe::proc::ExecContext::ExecContext ( const ProcessorProviderInterface p,
const AAAA::AAAAproviderInterface a 
)
inline

Constructor.

_Wolframe::proc::ExecContext::ExecContext ( const ExecContext )
private

Member Function Documentation

AAAA::Authenticator* _Wolframe::proc::ExecContext::authenticator ( const net::RemoteEndpoint client) const
inline

Get an authenticator.

const AAAA::Authorizer* _Wolframe::proc::ExecContext::authorizer ( ) const
inline

Get the authorization instance interface.

static const char* _Wolframe::proc::ExecContext::basicAuthorizationFunctionName ( BasicAuthorizationFunction  n)
inlinestatic

Get the name of a basic function.

bool _Wolframe::proc::ExecContext::checkAuthorization ( const std::string &  funcname,
const std::string &  resource,
std::string &  errmsg,
bool  allowIfNotExists = false 
)

Checks if a function tagged with AUTHORIZE( funcname, resource) is allowed to be executed.

bool _Wolframe::proc::ExecContext::checkAuthorization ( BasicAuthorizationFunction  f)
inline

Checks authorization for a basic function.

unsigned int _Wolframe::proc::ExecContext::defaultTimeout ( ) const
inline

Get the default timeout for read operations in seconds.

bool _Wolframe::proc::ExecContext::hasCapability ( const std::string &  c) const
inline

Ask for a capability for this execution context.

const net::LocalEndpoint* _Wolframe::proc::ExecContext::localEndpoint ( ) const
inline

Get the local endpoint for authorization checks.

void _Wolframe::proc::ExecContext::operator= ( const ExecContext )
private
AAAA::PasswordChanger* _Wolframe::proc::ExecContext::passwordChanger ( const net::RemoteEndpoint client) const
inline

Get a password changer.

void _Wolframe::proc::ExecContext::pop_database ( )
inline

Restore the previous current transaction database.

const ProcessorProviderInterface* _Wolframe::proc::ExecContext::provider ( ) const
inline

Get the processor provider interface.

void _Wolframe::proc::ExecContext::push_database ( const std::string &  dbname)
inline

Declare the database 'dbname' as the current transaction database.

const net::RemoteEndpoint* _Wolframe::proc::ExecContext::remoteEndpoint ( ) const
inline

Get the remote endpoint for authorization checks.

void _Wolframe::proc::ExecContext::setAuthorizer ( const AAAA::Authorizer a)
inline

Set the authorization instance interface.

void _Wolframe::proc::ExecContext::setConnectionData ( const net::RemoteEndpointR remoteEndpoint_,
const net::LocalEndpointR localEndpoint_ 
)
inline

Set the socket identifier for authorization checks.

void _Wolframe::proc::ExecContext::setDefaultTimeout ( unsigned int  timeout_sec_)
inline

Set the default timeout for read operations in seconds (0=forever)

void _Wolframe::proc::ExecContext::setUser ( AAAA::User u)
inline

Set the user instance.

Remarks
Allocated with new, owned by this from now
const char* _Wolframe::proc::ExecContext::socketIdentifier ( ) const
inline

Get the socket identifier for authorization checks.

db::Transaction* _Wolframe::proc::ExecContext::transaction ( const std::string &  name)

Create a new transaction object.

const AAAA::User* _Wolframe::proc::ExecContext::user ( ) const
inline

Get the the user instance reference.

Member Data Documentation

const AAAA::AAAAproviderInterface* _Wolframe::proc::ExecContext::m_aaaaProvider
private

instance to query for an authenticator

const AAAA::Authorizer* _Wolframe::proc::ExecContext::m_authorizer
private

instance to query for execution permission based on login data

std::vector<std::string> _Wolframe::proc::ExecContext::m_dbstack
private

stack for implementing current database as scope

unsigned int _Wolframe::proc::ExecContext::m_default_timeout
private

default timeout

net::LocalEndpointR _Wolframe::proc::ExecContext::m_localEndpoint
private

local end point of the connection

const ProcessorProviderInterface* _Wolframe::proc::ExecContext::m_provider
private

processor provider interface

net::RemoteEndpointR _Wolframe::proc::ExecContext::m_remoteEndpoint
private

remote end point of the connection

types::SecureReference<AAAA::User> _Wolframe::proc::ExecContext::m_user
private

user instance


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