Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes
ArcSec::LocalMapList Class Reference
Inheritance diagram for ArcSec::LocalMapList:
Inheritance graph
[legend]
Collaboration diagram for ArcSec::LocalMapList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LocalMapList (const std::vector< std::string > &files)
 LocalMapList (const std::string &file)
virtual ~LocalMapList (void)
virtual std::string ID (Arc::Message *msg)

Private Attributes

std::vector< std::string > files_

Detailed Description

Definition at line 67 of file IdentityMap.cpp.


Constructor & Destructor Documentation

ArcSec::LocalMapList::LocalMapList ( const std::vector< std::string > &  files)

Definition at line 77 of file IdentityMap.cpp.

                                                           :files_(files) {
}
ArcSec::LocalMapList::LocalMapList ( const std::string &  file)

Definition at line 80 of file IdentityMap.cpp.

                                                {
    files_.push_back(file);
}

Definition at line 84 of file IdentityMap.cpp.

                                {
}

Member Function Documentation

std::string ArcSec::LocalMapList::ID ( Arc::Message msg) [virtual]

Implements ArcSec::LocalMap.

Definition at line 112 of file IdentityMap.cpp.

                                          {
  // Compare user Grid identity to list in file.
  // So far only DN from TLS is supported.
  std::string dn = msg->Attributes()->get("TLS:IDENTITYDN");
  if(dn.empty()) return "";
  for (std::vector<std::string>::iterator it = files_.begin(); it != files_.end(); it++) {
    std::string file_ = *it;
    std::ifstream f(file_.c_str());
    if(!f.is_open() ) continue;
    for(;!f.eof();) {
      std::string buf;
      std::getline(f,buf);
      buf=Arc::trim(buf);
      if(buf.empty()) continue;
      if(buf[0] == '#') continue;
      std::string val = get_val(buf);
      if(val != dn) continue;
      buf=Arc::trim(buf);
      val=get_val(buf);
      if(val.empty()) continue;
      f.close();
      return val;
    };
    f.close();
  }
  return "";
}

Here is the call graph for this function:


Member Data Documentation

std::vector<std::string> ArcSec::LocalMapList::files_ [private]

Definition at line 69 of file IdentityMap.cpp.


The documentation for this class was generated from the following file: