Back to index

nordugrid-arc-nox  1.1.0~rc6
XACMLTarget.h
Go to the documentation of this file.
00001 #ifndef __ARC_SEC_XACMLTARGET_H__
00002 #define __ARC_SEC_XACMLTARGET_H__
00003 
00004 #include <list>
00005 #include <arc/XMLNode.h>
00006 #include <arc/security/ArcPDP/attr/AttributeValue.h>
00007 #include <arc/security/ArcPDP/fn/Function.h>
00008 #include <arc/security/ArcPDP/attr/AttributeFactory.h>
00009 #include <arc/security/ArcPDP/fn/FnFactory.h>
00010 #include <arc/security/ArcPDP/Evaluator.h>
00011 
00012 #include "./AttributeSelector.h"
00013 #include "./AttributeDesignator.h"
00014 
00015 namespace ArcSec {
00016 
00017 //<SubjectMatch/> <ResourceMatch/> <ActionMatch/>, or <EnvironmentMatch/>
00018 class XACMLTargetMatch {
00019 public:
00020   XACMLTargetMatch(Arc::XMLNode& node, EvaluatorContext* ctx);
00021   virtual ~XACMLTargetMatch();
00022   virtual MatchResult match(EvaluationCtx* ctx);
00023 
00024 private:
00025   AttributeFactory* attrfactory;
00026   FnFactory* fnfactory;
00027   Arc::XMLNode matchnode;
00028   std::string matchId;
00029 
00030   AttributeValue* attrval;
00031   Function* function;
00032   AttributeDesignator* designator;
00033   AttributeSelector* selector;
00034 };
00035 
00036 //node in higher level of above one, <Subject/> <Resource/> <Action/>, or <Environment/>
00037 class XACMLTargetMatchGroup {
00038 public:
00039   XACMLTargetMatchGroup(Arc::XMLNode& node, EvaluatorContext* ctx);
00040   virtual ~XACMLTargetMatchGroup();
00041   virtual MatchResult match(EvaluationCtx* ctx);
00042 
00043 private:
00044   Arc::XMLNode matchgrpnode;
00045   std::list<XACMLTargetMatch*> matches;
00046 };
00047 
00048 //node in higher level of above one, <Subjects/> <Resources/> <Actions/>, or <Environments/>
00049 class XACMLTargetSection {
00050 public:
00051   XACMLTargetSection(Arc::XMLNode& node, EvaluatorContext* ctx);
00052   virtual ~XACMLTargetSection();
00053   virtual MatchResult match(EvaluationCtx* ctx);
00054 
00055 private:
00056   Arc::XMLNode sectionnode;
00057   std::list<XACMLTargetMatchGroup*> groups;
00058 };
00059 
00061 //node in higher level of above one, <Target/>
00062 class XACMLTarget {
00063 public:
00065   XACMLTarget(Arc::XMLNode& node, EvaluatorContext* ctx);  
00066   virtual ~XACMLTarget();  
00067   virtual MatchResult match(EvaluationCtx* ctx);
00068 
00069 private:
00070   Arc::XMLNode targetnode;
00071   //std::list<XACMLTargetMatchSection*> sections;
00072   std::list<XACMLTargetSection*> sections;
00073 
00074 };
00075 
00076 } // namespace ArcSec
00077 
00078 #endif /* __ARC_SEC_XACMLTARGET_H__ */
00079