xrootd
XrdVomsFun.hh
Go to the documentation of this file.
1#ifndef ___XRD_VOMSFUN_H___
2#define ___XRD_VOMSFUN_H___
3/******************************************************************************/
4/* */
5/* X r d V o m s F u n . h h */
6/* */
7/* (C) 2013 G. Ganis, CERN */
8/* */
9/* All rights reserved. The copyright holder's institutional names may not */
10/* be used to endorse or promote products derived from this software without */
11/* specific prior written permission. */
12/* */
13/* This file is part of the VOMS extraction XRootD plug-in software suite, */
14/* here after called VOMS-XRootD (see https://github.com/gganis/voms). */
15/* */
16/* VOMS-XRootD is free software: you can redistribute it and/or modify it */
17/* under the terms of the GNU Lesser General Public License as published by */
18/* the Free Software Foundation, either version 3 of the License, or (at */
19/* your option) any later version. */
20/* */
21/* VOMS-XRootD is distributed in the hope that it will be useful, but */
22/* WITHOUT ANY WARRANTY, not even the implied warranty of MERCHANTABILITY or */
23/* FITNESS FOR A PARTICULAR PURPOSE. */
24/* See the GNU Lesser General Public License for more details. */
25/* */
26/* You should have received a copy of the GNU Lesser General Public License */
27/* along with VOMS-XRootD in a file called COPYING.LGPL (LGPL license) and */
28/* file COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
29/* */
30/******************************************************************************/
31
32#include "openssl/x509.h"
33#include "openssl/pem.h"
34
35#include "XrdOuc/XrdOucHash.hh"
37
38class XrdSecEntity;
39class XrdSysError;
40class XrdSysLogger;
41
43{
44public:
45
46// Supported cert formats
47//
51 gCertX509 = 2
52 };
53
55
57
58int VOMSInit(const char *cfg);
59
61
62 ~XrdVomsFun() {} // Once constructed never deleted (except for Http).
63
64private:
65
66void FmtExtract(XrdOucString &out, XrdOucString in, const char *tag);
67void NameOneLine(X509_NAME *nm, XrdOucString &s);
69
70// These settings are configurable
71//
72
73CertFormat gCertFmt; // certfmt: see constructor
74short gGrpWhich; // grpopt's which = 0|1|2 [2]
75short gDebug; // Verbosity control 0 | 1 | 2
76XrdOucHash<int> gGrps; // hash table with grps=grp1[,grp2,...]
77XrdOucHash<int> gVOs; // hash table with vos=vo1[,vo2,...]
78XrdOucString gRequire; // String with configuration options use to:
79XrdOucString gGrpFmt; // format contents of XrdSecEntity::grps
80XrdOucString gRoleFmt; // format contents of XrdSecEntity::role
81XrdOucString gVoFmt; // format contents of XrdSecEntity::vorg
82
85};
86#endif
Definition: XrdOucString.hh:254
Definition: XrdSecEntity.hh:52
Definition: XrdSysError.hh:90
Definition: XrdSysLogger.hh:53
Definition: XrdVomsFun.hh:43
short gDebug
Definition: XrdVomsFun.hh:75
XrdSysError & gDest
Definition: XrdVomsFun.hh:83
XrdVomsFun(XrdSysError &erp)
void SetCertFmt(CertFormat n)
Definition: XrdVomsFun.hh:54
XrdOucString gRoleFmt
Definition: XrdVomsFun.hh:80
CertFormat gCertFmt
Definition: XrdVomsFun.hh:73
int VOMSInit(const char *cfg)
XrdSysLogger * gLogger
Definition: XrdVomsFun.hh:84
XrdOucHash< int > gVOs
Definition: XrdVomsFun.hh:77
int VOMSFun(XrdSecEntity &ent)
void FmtReplace(XrdSecEntity &ent)
XrdOucHash< int > gGrps
Definition: XrdVomsFun.hh:76
void FmtExtract(XrdOucString &out, XrdOucString in, const char *tag)
XrdOucString gGrpFmt
Definition: XrdVomsFun.hh:79
XrdOucString gVoFmt
Definition: XrdVomsFun.hh:81
XrdOucString gRequire
Definition: XrdVomsFun.hh:78
short gGrpWhich
Definition: XrdVomsFun.hh:74
CertFormat
Definition: XrdVomsFun.hh:49
@ gCertX509
Definition: XrdVomsFun.hh:51
@ gCertPEM
Definition: XrdVomsFun.hh:50
@ gCertRaw
Definition: XrdVomsFun.hh:49
void NameOneLine(X509_NAME *nm, XrdOucString &s)
~XrdVomsFun()
Definition: XrdVomsFun.hh:62