xrootd
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Macaroons::Handler Class Reference

#include <XrdMacaroonsHandler.hh>

Inheritance diagram for Macaroons::Handler:
Inheritance graph
[legend]
Collaboration diagram for Macaroons::Handler:
Collaboration graph
[legend]

Public Types

enum  AuthzBehavior { PASSTHROUGH , ALLOW , DENY }
 

Public Member Functions

 Handler (XrdSysError *log, const char *config, XrdOucEnv *myEnv, XrdAccAuthorize *chain)
 
virtual ~Handler ()
 
virtual bool MatchesPath (const char *verb, const char *path) override
 Tells if the incoming path is recognized as one of the paths that have to be processed.
 
virtual int ProcessReq (XrdHttpExtReq &req) override
 
virtual int Init (const char *cfgfile) override
 Initializes the external request handler.
 
- Public Member Functions inherited from XrdHttpExtHandler
 XrdHttpExtHandler ()
 Constructor.
 
virtual ~XrdHttpExtHandler ()
 Destructor.
 

Static Public Member Functions

static bool Config (const char *config, XrdOucEnv *env, XrdSysError *log, std::string &location, std::string &secret, ssize_t &max_duration, AuthzBehavior &behavior)
 

Private Member Functions

std::string GenerateID (const std::string &, const XrdSecEntity &, const std::string &, const std::vector< std::string > &, const std::string &)
 
std::string GenerateActivities (const XrdHttpExtReq &, const std::string &) const
 
int ProcessOAuthConfig (XrdHttpExtReq &req)
 
int ProcessTokenRequest (XrdHttpExtReq &req)
 
int GenerateMacaroonResponse (XrdHttpExtReq &req, const std::string &response, const std::vector< std::string > &, ssize_t validity, bool oauth_response)
 

Static Private Member Functions

static bool xsecretkey (XrdOucStream &Config, XrdSysError *log, std::string &secret)
 
static bool xsitename (XrdOucStream &Config, XrdSysError *log, std::string &location)
 
static bool xtrace (XrdOucStream &Config, XrdSysError *log)
 
static bool xmaxduration (XrdOucStream &Config, XrdSysError *log, ssize_t &max_duration)
 

Private Attributes

ssize_t m_max_duration
 
XrdAccAuthorizem_chain
 
XrdSysErrorm_log
 
std::string m_location
 
std::string m_secret
 

Member Enumeration Documentation

◆ AuthzBehavior

Enumerator
PASSTHROUGH 
ALLOW 
DENY 

Constructor & Destructor Documentation

◆ Handler()

Macaroons::Handler::Handler ( XrdSysError log,
const char *  config,
XrdOucEnv myEnv,
XrdAccAuthorize chain 
)
inline

◆ ~Handler()

virtual Macaroons::Handler::~Handler ( )
virtual

Member Function Documentation

◆ Config()

static bool Macaroons::Handler::Config ( const char *  config,
XrdOucEnv env,
XrdSysError log,
std::string &  location,
std::string &  secret,
ssize_t &  max_duration,
AuthzBehavior behavior 
)
static

Referenced by Handler().

◆ GenerateActivities()

std::string Macaroons::Handler::GenerateActivities ( const XrdHttpExtReq ,
const std::string &   
) const
private

◆ GenerateID()

std::string Macaroons::Handler::GenerateID ( const std::string &  ,
const XrdSecEntity ,
const std::string &  ,
const std::vector< std::string > &  ,
const std::string &   
)
private

◆ GenerateMacaroonResponse()

int Macaroons::Handler::GenerateMacaroonResponse ( XrdHttpExtReq req,
const std::string &  response,
const std::vector< std::string > &  ,
ssize_t  validity,
bool  oauth_response 
)
private

◆ Init()

virtual int Macaroons::Handler::Init ( const char *  cfgfile)
inlineoverridevirtual

Initializes the external request handler.

Implements XrdHttpExtHandler.

◆ MatchesPath()

virtual bool Macaroons::Handler::MatchesPath ( const char *  verb,
const char *  path 
)
overridevirtual

Tells if the incoming path is recognized as one of the paths that have to be processed.

Implements XrdHttpExtHandler.

◆ ProcessOAuthConfig()

int Macaroons::Handler::ProcessOAuthConfig ( XrdHttpExtReq req)
private

◆ ProcessReq()

virtual int Macaroons::Handler::ProcessReq ( XrdHttpExtReq )
overridevirtual

Process an HTTP request and send the response using the calling XrdHttpProtocol instance directly Returns 0 if ok, non0 if errors

Implements XrdHttpExtHandler.

◆ ProcessTokenRequest()

int Macaroons::Handler::ProcessTokenRequest ( XrdHttpExtReq req)
private

◆ xmaxduration()

static bool Macaroons::Handler::xmaxduration ( XrdOucStream Config,
XrdSysError log,
ssize_t &  max_duration 
)
staticprivate

◆ xsecretkey()

static bool Macaroons::Handler::xsecretkey ( XrdOucStream Config,
XrdSysError log,
std::string &  secret 
)
staticprivate

◆ xsitename()

static bool Macaroons::Handler::xsitename ( XrdOucStream Config,
XrdSysError log,
std::string &  location 
)
staticprivate

◆ xtrace()

static bool Macaroons::Handler::xtrace ( XrdOucStream Config,
XrdSysError log 
)
staticprivate

Member Data Documentation

◆ m_chain

XrdAccAuthorize* Macaroons::Handler::m_chain
private

◆ m_location

std::string Macaroons::Handler::m_location
private

Referenced by Handler().

◆ m_log

XrdSysError* Macaroons::Handler::m_log
private

Referenced by Handler().

◆ m_max_duration

ssize_t Macaroons::Handler::m_max_duration
private

Referenced by Handler().

◆ m_secret

std::string Macaroons::Handler::m_secret
private

Referenced by Handler().


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