#include <XrdMacaroonsHandler.hh>
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. | |
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 |
XrdAccAuthorize * | m_chain |
XrdSysError * | m_log |
std::string | m_location |
std::string | m_secret |
Macaroons::Handler::Handler | ( | XrdSysError * | log, | |
const char * | config, | |||
XrdOucEnv * | myEnv, | |||
XrdAccAuthorize * | chain | |||
) | [inline] |
References Config(), m_location, m_log, m_max_duration, and m_secret.
virtual Macaroons::Handler::~Handler | ( | ) | [virtual] |
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().
std::string Macaroons::Handler::GenerateActivities | ( | const XrdHttpExtReq & | , | |
const std::string & | ||||
) | const [private] |
std::string Macaroons::Handler::GenerateID | ( | const std::string & | , | |
const XrdSecEntity & | , | |||
const std::string & | , | |||
const std::vector< std::string > & | , | |||
const std::string & | ||||
) | [private] |
int Macaroons::Handler::GenerateMacaroonResponse | ( | XrdHttpExtReq & | req, | |
const std::string & | response, | |||
const std::vector< std::string > & | , | |||
ssize_t | validity, | |||
bool | oauth_response | |||
) | [private] |
virtual int Macaroons::Handler::Init | ( | const char * | cfgfile | ) | [inline, override, virtual] |
Initializes the external request handler.
Implements XrdHttpExtHandler.
virtual bool Macaroons::Handler::MatchesPath | ( | const char * | verb, | |
const char * | path | |||
) | [override, virtual] |
Tells if the incoming path is recognized as one of the paths that have to be processed.
Implements XrdHttpExtHandler.
int Macaroons::Handler::ProcessOAuthConfig | ( | XrdHttpExtReq & | req | ) | [private] |
virtual int Macaroons::Handler::ProcessReq | ( | XrdHttpExtReq & | ) | [override, virtual] |
Process an HTTP request and send the response using the calling XrdHttpProtocol instance directly Returns 0 if ok, non0 if errors
Implements XrdHttpExtHandler.
int Macaroons::Handler::ProcessTokenRequest | ( | XrdHttpExtReq & | req | ) | [private] |
static bool Macaroons::Handler::xmaxduration | ( | XrdOucStream & | Config, | |
XrdSysError * | log, | |||
ssize_t & | max_duration | |||
) | [static, private] |
static bool Macaroons::Handler::xsecretkey | ( | XrdOucStream & | Config, | |
XrdSysError * | log, | |||
std::string & | secret | |||
) | [static, private] |
static bool Macaroons::Handler::xsitename | ( | XrdOucStream & | Config, | |
XrdSysError * | log, | |||
std::string & | location | |||
) | [static, private] |
static bool Macaroons::Handler::xtrace | ( | XrdOucStream & | Config, | |
XrdSysError * | log | |||
) | [static, private] |
XrdAccAuthorize* Macaroons::Handler::m_chain [private] |
std::string Macaroons::Handler::m_location [private] |
Referenced by Handler().
XrdSysError* Macaroons::Handler::m_log [private] |
Referenced by Handler().
ssize_t Macaroons::Handler::m_max_duration [private] |
Referenced by Handler().
std::string Macaroons::Handler::m_secret [private] |
Referenced by Handler().