XRootD
Loading...
Searching...
No Matches
XrdMacaroonsConfigure.cc File Reference
#include "XrdMacaroonsHandler.hh"
#include "XrdOuc/XrdOucStream.hh"
#include "XrdSys/XrdSysE2T.hh"
#include <cerrno>
#include <fcntl.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
+ Include dependency graph for XrdMacaroonsConfigure.cc:

Go to the source code of this file.

Functions

static bool xonmissing (XrdOucStream &config_obj, XrdSysError *log, Handler::AuthzBehavior &behavior)
 

Function Documentation

◆ xonmissing()

static bool xonmissing ( XrdOucStream & config_obj,
XrdSysError * log,
Handler::AuthzBehavior & behavior )
static

Definition at line 14 of file XrdMacaroonsConfigure.cc.

15{
16 char *val = config_obj.GetWord();
17 if (!val || !val[0])
18 {
19 log->Emsg("Config", "macaroons.onmissing requires a value (valid values: passthrough [default], allow, deny)");
20 return false;
21 }
22 if (!strcasecmp(val, "passthrough")) {
23 behavior = Handler::AuthzBehavior::PASSTHROUGH;
24 } else if (!strcasecmp(val, "allow")) {
25 behavior = Handler::AuthzBehavior::ALLOW;
26 } else if (!strcasecmp(val, "deny")) {
27 behavior = Handler::AuthzBehavior::DENY;
28 } else
29 {
30 log->Emsg("Config", "macaroons.onmissing is invalid (valid values: passthrough [default], allow, deny)! Provided value:", val);
31 return false;
32 }
33 return true;
34}
char * GetWord(int lowcase=0)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)

References Macaroons::Handler::ALLOW, Macaroons::Handler::DENY, XrdSysError::Emsg(), XrdOucStream::GetWord(), and Macaroons::Handler::PASSTHROUGH.

Referenced by Macaroons::Handler::Config().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: