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