xrootd
XrdSecEntity.hh
Go to the documentation of this file.
1 #ifndef __SEC_ENTITY_H__
2 #define __SEC_ENTITY_H__
3 /******************************************************************************/
4 /* */
5 /* X r d S e c E n t i t y . h h */
6 /* */
7 /* (c) 2019 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* Produced by Andrew Hanushevsky for Stanford University under contract */
9 /* DE-AC02-76-SFO0515 with the Department of Energy */
10 /* */
11 /* This file is part of the XRootD software suite. */
12 /* */
13 /* XRootD is free software: you can redistribute it and/or modify it under */
14 /* the terms of the GNU Lesser General Public License as published by the */
15 /* Free Software Foundation, either version 3 of the License, or (at your */
16 /* option) any later version. */
17 /* */
18 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
19 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
20 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
21 /* License for more details. */
22 /* */
23 /* You should have received a copy of the GNU Lesser General Public License */
24 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
25 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
26 /* */
27 /* The copyright holder's institutional names and contributor's names may not */
28 /* be used to endorse or promote products derived from this software without */
29 /* specific prior written permission of the institution or contributor. */
30 /******************************************************************************/
31 
32 //------------------------------------------------------------------------------
43 //------------------------------------------------------------------------------
44 
45 #include <sys/types.h>
46 
47 #define XrdSecPROTOIDSIZE 8
48 
49 class XrdNetAddrInfo;
50 class XrdSecEntityAttr;
51 class XrdSysError;
52 
53 /******************************************************************************/
54 /* X r d S e c E n t i t y */
55 /******************************************************************************/
56 
57 // The XrdSecEntity describes the client associated with a connection. One
58 // such object is allocated for each clent connection and it persists until
59 // the connection is closed. Note that when an entity has more than one
60 // role or vorg, the fields <vorg, role, grps> form a columnar tuple. This
61 // tuple must be repeated whenever any one of the values differs.
62 //
64 {
65 public:
68  char *name;
69  char *host;
70  char *vorg;
71  char *role;
72  char *grps;
73  char *caps;
74  char *endorsements;
75  char *moninfo;
76  char *creds;
77  int credslen;
78 unsigned int ueid;
80 const char *tident;
81 const char *pident;
82  void *sessvar;
85  uid_t uid;
86  gid_t gid;
87 
88  void *future[3];
89 
91 
92 //------------------------------------------------------------------------------
96 //------------------------------------------------------------------------------
97 
98  void Display(XrdSysError &mDest);
99 
100 //------------------------------------------------------------------------------
104 //------------------------------------------------------------------------------
105 
106  void Reset(const char *spV=0);
107 
108 //------------------------------------------------------------------------------
112 //------------------------------------------------------------------------------
113 
114  XrdSecEntity(const char *spName=0);
115 
117 
118 private:
119 void Init(const char *spV);
120 };
121 
122 #define XrdSecClientName XrdSecEntity
123 #define XrdSecServerName XrdSecEntity
124 
125 #endif
#define XrdSecPROTOIDSIZE
Definition: XrdSecEntity.hh:47
Definition: XrdNetAddrInfo.hh:54
Definition: XrdSecEntityAttr.hh:55
Definition: XrdSecEntity.hh:64
char * vorg
Entity's virtual organization(s)
Definition: XrdSecEntity.hh:70
const char * pident
Trace identifier (originator)
Definition: XrdSecEntity.hh:81
int credslen
Length of the 'creds' data.
Definition: XrdSecEntity.hh:77
char prox[XrdSecPROTOIDSIZE]
Auth extractor used (e.g. xrdvoms)
Definition: XrdSecEntity.hh:67
XrdNetAddrInfo * addrInfo
Entity's connection details.
Definition: XrdSecEntity.hh:79
XrdSecEntityAttr * eaAPI
non-const API to attributes
Definition: XrdSecEntity.hh:90
const char * tident
Trace identifier always preset.
Definition: XrdSecEntity.hh:80
char prot[XrdSecPROTOIDSIZE]
Auth protocol used (e.g. krb5)
Definition: XrdSecEntity.hh:66
char * caps
Entity's capabilities.
Definition: XrdSecEntity.hh:73
char * creds
Raw entity credentials or cert.
Definition: XrdSecEntity.hh:76
gid_t gid
Unix gid or 0 if none.
Definition: XrdSecEntity.hh:86
void * future[3]
Reserved for future expansion.
Definition: XrdSecEntity.hh:88
void * sessvar
Definition: XrdSecEntity.hh:82
char * grps
Entity's group name(s)
Definition: XrdSecEntity.hh:72
void Reset(const char *spV=0)
XrdSecEntity(const char *spName=0)
uid_t uid
Unix uid or 0 if none.
Definition: XrdSecEntity.hh:85
void Init(const char *spV)
char * name
Entity's name.
Definition: XrdSecEntity.hh:68
unsigned int ueid
Unique ID of entity instance.
Definition: XrdSecEntity.hh:78
char * role
Entity's role(s)
Definition: XrdSecEntity.hh:71
char * endorsements
Protocol specific endorsements.
Definition: XrdSecEntity.hh:74
void Display(XrdSysError &mDest)
char * moninfo
Information for monitoring.
Definition: XrdSecEntity.hh:75
char * host
Entity's host name dnr dependent.
Definition: XrdSecEntity.hh:69
Definition: XrdSysError.hh:90