Skip to content

Commit

Permalink
[Sec] Add method that returns all of the attribute keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
abh3 authored and osschar committed Oct 10, 2019
1 parent 7c85c16 commit 853f1c4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/XrdSec/XrdSecEntity.cc
Expand Up @@ -136,6 +136,22 @@ bool XrdSecEntity::Get(const std::string &key, std::string &val)
return false;
}

/******************************************************************************/
/* K e y s */
/******************************************************************************/

std::vector<std::string> XrdSecEntity::Keys()
{
XrdSysMutexHelper mHelp(entXtra->xMutex);
std::map<std::string, std::string>::iterator itM;
std::vector<std::string> keyVec;

for (itM = entXtra->attrMap.begin();
itM != entXtra->attrMap.end(); itM++) keyVec.push_back(itM->first);

return keyVec;
}

/******************************************************************************/
/* L i s t */
/******************************************************************************/
Expand Down
9 changes: 9 additions & 0 deletions src/XrdSec/XrdSecEntity.hh
Expand Up @@ -43,6 +43,7 @@
//------------------------------------------------------------------------------

#include <string>
#include <vector>

#define XrdSecPROTOIDSIZE 8

Expand Down Expand Up @@ -134,6 +135,14 @@ XrdSecAttr *Get(const void *sigkey);

bool Get(const std::string &key, std::string &val);

//------------------------------------------------------------------------------
//! Get all the keys for associated attribytes.
//!
//! @return A vector containing all of the keys.
//------------------------------------------------------------------------------

std::vector<std::string> Keys();

//------------------------------------------------------------------------------
//! List key-value pairs via iterative callback on passed ovject.
//!
Expand Down

0 comments on commit 853f1c4

Please sign in to comment.