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"
36 #include "XrdOuc/XrdOucString.hh"
37 
38 class XrdSecEntity;
39 class XrdSysError;
40 class XrdSysLogger;
41 class XrdVomsMapfile;
42 
44 {
45 public:
46 
47 // Supported cert formats
48 //
50  {gCertRaw = 0,
51  gCertPEM = 1,
52  gCertX509 = 2
53  };
54 
56 
58 
59 int VOMSInit(const char *cfg);
60 
62 
63  ~XrdVomsFun() {} // Once constructed never deleted (except for Http).
64 
65 private:
66 
67 void FmtExtract(XrdOucString &out, XrdOucString in, const char *tag);
68 void NameOneLine(X509_NAME *nm, XrdOucString &s);
70 
71 // These settings are configurable
72 //
73 
74 CertFormat gCertFmt; // certfmt: see constructor
75 short gGrpWhich; // grpopt's which = 0|1|2 [2]
76 short gDebug; // Verbosity control 0 | 1 | 2
77 XrdOucHash<int> gGrps; // hash table with grps=grp1[,grp2,...]
78 XrdOucHash<int> gVOs; // hash table with vos=vo1[,vo2,...]
79 XrdOucString gRequire; // String with configuration options use to:
80 XrdOucString gGrpFmt; // format contents of XrdSecEntity::grps
81 XrdOucString gRoleFmt; // format contents of XrdSecEntity::role
82 XrdOucString gVoFmt; // format contents of XrdSecEntity::vorg
83 
86 
88 };
89 #endif
Definition: XrdOucString.hh:254
Definition: XrdSecEntity.hh:64
Definition: XrdSysError.hh:90
Definition: XrdSysLogger.hh:53
Definition: XrdVomsFun.hh:44
XrdVomsMapfile * m_mapfile
Definition: XrdVomsFun.hh:87
short gDebug
Definition: XrdVomsFun.hh:76
XrdSysError & gDest
Definition: XrdVomsFun.hh:84
XrdVomsFun(XrdSysError &erp)
void SetCertFmt(CertFormat n)
Definition: XrdVomsFun.hh:55
XrdOucString gRoleFmt
Definition: XrdVomsFun.hh:81
CertFormat gCertFmt
Definition: XrdVomsFun.hh:74
int VOMSInit(const char *cfg)
XrdSysLogger * gLogger
Definition: XrdVomsFun.hh:85
XrdOucHash< int > gVOs
Definition: XrdVomsFun.hh:78
int VOMSFun(XrdSecEntity &ent)
void FmtReplace(XrdSecEntity &ent)
XrdOucHash< int > gGrps
Definition: XrdVomsFun.hh:77
void FmtExtract(XrdOucString &out, XrdOucString in, const char *tag)
XrdOucString gGrpFmt
Definition: XrdVomsFun.hh:80
XrdOucString gVoFmt
Definition: XrdVomsFun.hh:82
XrdOucString gRequire
Definition: XrdVomsFun.hh:79
short gGrpWhich
Definition: XrdVomsFun.hh:75
CertFormat
Definition: XrdVomsFun.hh:50
@ gCertX509
Definition: XrdVomsFun.hh:52
@ gCertPEM
Definition: XrdVomsFun.hh:51
@ gCertRaw
Definition: XrdVomsFun.hh:50
void NameOneLine(X509_NAME *nm, XrdOucString &s)
~XrdVomsFun()
Definition: XrdVomsFun.hh:63
Definition: XrdVomsMapfile.hh:37