Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes
ArcSec::AttributeDesignator Class Reference

#include <AttributeDesignator.h>

Collaboration diagram for ArcSec::AttributeDesignator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AttributeDesignator (Arc::XMLNode &node, AttributeFactory *attr_factory)
virtual ~AttributeDesignator ()
virtual std::list
< AttributeValue * > 
evaluate (EvaluationCtx *ctx)

Private Attributes

std::string target
std::string id
std::string type
std::string category
std::string issuer
bool present
AttributeFactoryattrfactory

Detailed Description

Definition at line 16 of file AttributeDesignator.h.


Constructor & Destructor Documentation

Definition at line 10 of file AttributeDesignator.cpp.

    : present(false), attrfactory(attr_factory) {
  std::string name = node.Name();
  size_t found = name.find("AttributeDesignator");
  target = name.substr(0, found);

  id = (std::string)(node.Attribute("AttributeId")); 
  if(id.empty()) {std::cerr<<"Required AttributeId does not exist in AttributeDesignator"<<std::endl; exit(0);}

  std::string tp = (std::string)(node.Attribute("DataType"));
  if(tp.empty()) {std::cerr<<"Required DataType does not exist in AttributeDesignator"<<std::endl; exit(0);}

  type = tp;
  
#if 0
  found = tp.find_last_of("#");
  if(found!=std::string::npos) {
    type = tp.substr(found+1);
  }
  else {
    found=tp.find_last_of(":"); //urn:oasis:names:tc:xacml:1.0:data-type:rfc822Name
    type = tp.substr(found+1);
  }
#endif

  issuer = (std::string)(node.Attribute("Issuer"));

  if(target=="Subject") {
    category = (std::string)(node.Attribute("SubjectCategory"));
    if(category.empty()) category = "urn:oasis:names:tc:xacml:1.0:subject-category:access-subject";
  }
  
  std::string must = node.Attribute("MustBePresent");
  if(!must.empty()) present = true;
}

Here is the call graph for this function:

Definition at line 46 of file AttributeDesignator.cpp.

                                          {
}

Member Function Documentation

std::list< AttributeValue * > AttributeDesignator::evaluate ( EvaluationCtx ctx) [virtual]

Definition at line 49 of file AttributeDesignator.cpp.

                                                                         {
  std::list<AttributeValue*> res;
  if(target == "Subject") { res = ctx->getSubjectAttributes(id, type, issuer, category, attrfactory); } 
  else if(target == "Resource") { res = ctx->getResourceAttributes(id, type, issuer, attrfactory); }
  else if(target == "Action") { res = ctx->getActionAttributes(id, type, issuer, attrfactory); }
  else if(target == "Environment") { res = ctx->getContextAttributes(id, type, issuer, attrfactory); }

  if(present && (res.size() ==0)) {
    std::cerr<<"AttributeDesignator requires at least one attributes from request's"<<target<<std::endl;
  }

  return res;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 32 of file AttributeDesignator.h.

Definition at line 27 of file AttributeDesignator.h.

std::string ArcSec::AttributeDesignator::id [private]

Definition at line 25 of file AttributeDesignator.h.

std::string ArcSec::AttributeDesignator::issuer [private]

Definition at line 28 of file AttributeDesignator.h.

Definition at line 30 of file AttributeDesignator.h.

std::string ArcSec::AttributeDesignator::target [private]

Definition at line 24 of file AttributeDesignator.h.

std::string ArcSec::AttributeDesignator::type [private]

Definition at line 26 of file AttributeDesignator.h.


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