xrootd
Loading...
Searching...
No Matches
XrdDigAuth.hh
Go to the documentation of this file.
1#ifndef __XRDDIGAUTH_HH__
2#define __XRDDIGAUTH_HH__
3/******************************************************************************/
4/* */
5/* X r d D i g A u t h . h h */
6/* */
7/* (C) 2013 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Deprtment of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
35
36class XrdOucStream;
37class XrdSysError;
38
39/******************************************************************************/
40/* X r d D i g A u t h E n t */
41/******************************************************************************/
42
44{
45public:
47char *rec;
49
50enum eType {eName=0, eHost=1, eVorg=2, eRole=3, eGrp=4, eNum=5};
51char *eChk[eNum];
52
53enum aType {aConf = 0, aCore = 1, aLogs = 2, aProc = 3, aNum = 4};
54bool accOK[aNum];
55
57 {memset(prot, 0, sizeof(prot));
58 memset(eChk, 0, sizeof(eChk));
59 memset(accOK, 0, sizeof(accOK));
60 }
61 ~XrdDigAuthEnt() {if (rec) free(rec);}
62};
63
64/******************************************************************************/
65/* X r d D i g A u t h */
66/******************************************************************************/
67
69{
70public:
71
72bool Authorize(const XrdSecEntity *client,
74 bool aVec[XrdDigAuthEnt::aNum]=0
75 );
76
77bool Configure(const char *aFN);
78
81
82private:
83
84bool Failure(int lNum, const char *txt1, const char *txt2=0);
85bool OkGrp(const char *glist, const char *gname);
86bool Parse(XrdOucStream &aFile, int lNum);
87bool Refresh();
88bool SetupAuth(bool isRefresh);
89bool SetupAuth(bool isRefresh, bool aOK);
90void Squash(char *bP);
91
93const char *authFN;
94time_t authTOD;
95time_t authCHK;
98};
99#endif
#define XrdSecPROTOIDSIZE
Definition XrdSecEntity.hh:47
Definition XrdDigAuth.hh:44
char * rec
Definition XrdDigAuth.hh:47
char prot[XrdSecPROTOIDSIZE]
Definition XrdDigAuth.hh:48
aType
Definition XrdDigAuth.hh:53
@ aProc
Definition XrdDigAuth.hh:53
@ aLogs
Definition XrdDigAuth.hh:53
@ aNum
Definition XrdDigAuth.hh:53
@ aCore
Definition XrdDigAuth.hh:53
@ aConf
Definition XrdDigAuth.hh:53
eType
Definition XrdDigAuth.hh:50
@ eHost
Definition XrdDigAuth.hh:50
@ eGrp
Definition XrdDigAuth.hh:50
@ eNum
Definition XrdDigAuth.hh:50
@ eRole
Definition XrdDigAuth.hh:50
@ eVorg
Definition XrdDigAuth.hh:50
@ eName
Definition XrdDigAuth.hh:50
~XrdDigAuthEnt()
Definition XrdDigAuth.hh:61
char * eChk[eNum]
Definition XrdDigAuth.hh:51
XrdDigAuthEnt * next
Definition XrdDigAuth.hh:46
XrdDigAuthEnt()
Definition XrdDigAuth.hh:56
bool accOK[aNum]
Definition XrdDigAuth.hh:54
Definition XrdDigAuth.hh:69
bool OkGrp(const char *glist, const char *gname)
~XrdDigAuth()
Definition XrdDigAuth.hh:80
XrdDigAuthEnt * authList
Definition XrdDigAuth.hh:96
const char * authFN
Definition XrdDigAuth.hh:93
bool SetupAuth(bool isRefresh, bool aOK)
bool Authorize(const XrdSecEntity *client, XrdDigAuthEnt::aType aType, bool aVec[XrdDigAuthEnt::aNum]=0)
void Squash(char *bP)
XrdDigAuth()
Definition XrdDigAuth.hh:79
bool SetupAuth(bool isRefresh)
bool Failure(int lNum, const char *txt1, const char *txt2=0)
time_t authCHK
Definition XrdDigAuth.hh:95
XrdSysMutex authMutex
Definition XrdDigAuth.hh:92
bool Configure(const char *aFN)
time_t authTOD
Definition XrdDigAuth.hh:94
bool accOK[XrdDigAuthEnt::aNum]
Definition XrdDigAuth.hh:97
bool Refresh()
bool Parse(XrdOucStream &aFile, int lNum)
Definition XrdOucStream.hh:47
Definition XrdSecEntity.hh:65
Definition XrdSysError.hh:90
Definition XrdSysPthread.hh:165