xrootd
Loading...
Searching...
No Matches
XrdSecEntityAttr.hh
Go to the documentation of this file.
1#ifndef __SEC_ENTITYATTR_H__
2#define __SEC_ENTITYATTR_H__
3/******************************************************************************/
4/* */
5/* X r d S e c E n t i t y A t t r . 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//------------------------------------------------------------------------------
39//------------------------------------------------------------------------------
40
41#include <sys/types.h>
42
43#include <string>
44#include <vector>
45
46class XrdSecAttr;
49
50/******************************************************************************/
51/* X r d S e c E n t i t y A t t r */
52/******************************************************************************/
53
55{
56public:
57friend class XrdSecEntity;
58
59//------------------------------------------------------------------------------
66//------------------------------------------------------------------------------
67
68 bool Add(XrdSecAttr &attr);
69
70//------------------------------------------------------------------------------
80//------------------------------------------------------------------------------
81
82 bool Add(const std::string &key,
83 const std::string &val, bool replace=false);
84
85//------------------------------------------------------------------------------
92//------------------------------------------------------------------------------
93
94XrdSecAttr *Get(const void *sigkey);
95
96//------------------------------------------------------------------------------
104//------------------------------------------------------------------------------
105
106 bool Get(const std::string &key, std::string &val);
107
108//------------------------------------------------------------------------------
112//------------------------------------------------------------------------------
113
114std::vector<std::string> Keys();
115
116//------------------------------------------------------------------------------
120//------------------------------------------------------------------------------
121
123
124//------------------------------------------------------------------------------
128//------------------------------------------------------------------------------
129
131
133
134private:
135
137};
138
139/******************************************************************************/
140/* X r d S e c E n t i t y A t t r C B */
141/******************************************************************************/
142
143// The XrdSecEntityAttrCB class defines the callback object passed to the
144// XrdSecEntity::List() method to iteratively obtain the key-value attribute
145// pairs associated with the entity. The XrdSecEntityAttrCB::Attr() method is
146// called for each key-value pair. The end of the list is indicated by calling
147// Attr() with nil key-value pointers. The Attr() method should not call
148// the XrdSecEntity::Add() or XrdSecEntity::Get() methods; otherwise, a
149// deadlock will occur.
150//
152{
153public:
154
155//------------------------------------------------------------------------------
163//------------------------------------------------------------------------------
164
165enum Action {Delete = -1,
166 Stop = 0,
167 Next = 1
168 };
169
170virtual Action Attr(const char *key, const char *val) = 0;
171
172//------------------------------------------------------------------------------
174//------------------------------------------------------------------------------
175
178};
179#endif
Definition XrdSecAttr.hh:61
Definition XrdSecEntityAttr.hh:152
Action
Definition XrdSecEntityAttr.hh:165
@ Stop
Stop the iteration.
Definition XrdSecEntityAttr.hh:166
@ Next
Proceed to the next key-value pair.
Definition XrdSecEntityAttr.hh:167
@ Delete
Delete the key-value and proceed to next one.
Definition XrdSecEntityAttr.hh:165
virtual ~XrdSecEntityAttrCB()
Definition XrdSecEntityAttr.hh:177
virtual Action Attr(const char *key, const char *val)=0
XrdSecEntityAttrCB()
Constructor and Destructor.
Definition XrdSecEntityAttr.hh:176
Definition XrdSecEntityAttr.hh:55
bool Add(XrdSecAttr &attr)
XrdSecAttr * Get(const void *sigkey)
std::vector< std::string > Keys()
bool Add(const std::string &key, const std::string &val, bool replace=false)
XrdSecEntityXtra * entXtra
Definition XrdSecEntityAttr.hh:136
~XrdSecEntityAttr()
Definition XrdSecEntityAttr.hh:132
XrdSecEntityAttr(XrdSecEntityXtra *xtra)
Definition XrdSecEntityAttr.hh:130
void List(XrdSecEntityAttrCB &attrCB)
bool Get(const std::string &key, std::string &val)
Definition XrdSecEntityXtra.hh:40
Definition XrdSecEntity.hh:65