XRootD
XrdMacaroonsConfigure.cc File Reference
#include <fcntl.h>
#include <cerrno>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <XrdOuc/XrdOucStream.hh>
#include <XrdSys/XrdSysE2T.hh>
#include "XrdMacaroonsHandler.hh"
+ 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 17 of file XrdMacaroonsConfigure.cc.

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

References XrdSysError::Emsg(), and XrdOucStream::GetWord().

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

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