Back to index

nordugrid-arc-nox  1.1.0~rc6
DelegationSH.h
Go to the documentation of this file.
00001 #ifndef __ARC_SEC_DELEGATIONSH_H__
00002 #define __ARC_SEC_DELEGATIONSH_H__
00003 
00004 #include <stdlib.h>
00005 
00006 #include <arc/ArcConfig.h>
00007 #include <arc/message/Message.h>
00008 #include <arc/message/SecHandler.h>
00009 
00010 namespace ArcSec {
00011 
00013 
00014 class DelegationContext;
00015 
00016 class DelegationSH : public SecHandler {
00017  private:
00018   enum {
00019     delegation_delegator,
00020     delegation_delegatee
00021   } delegation_role_;
00022   enum {
00023     delegation_x509,
00024     delegation_saml
00025   } delegation_type_;
00026   std::string ds_endpoint_; //endpoint of delegation service,
00027                             // to which this Sec handler will
00028                             // create a delegation credential
00029   std::string peers_endpoint_; //endpoint of the peer service, to which
00030                                //the real service invokation will be called.
00031                                //This variable is only valid for the delegator
00032                                //role Delegation handler.
00033   std::string delegation_id_; //The delegation ID which is used to 
00034                               //be send to the peer service side. The 
00035                               //variable is only valid for the delegator role
00036                               //Delegation handler.
00037                               //The delegator role delegation handler is only need
00038                               //to be set if it is configured in a client.
00039                               //If the delegator role Delegation handler is configured 
00040                               //in a service, then delegation_id_ delegation_id
00041                               //does not need to set.
00042   std::string delegation_cred_identity_;
00043   std::string cert_file_;
00044   std::string key_file_;
00045   std::string proxy_file_;
00046   std::string ca_file_;
00047   std::string ca_dir_;
00048 
00049   Arc::MessageContextElement* mcontext_;
00050 
00051  protected:
00052   static Arc::Logger logger;
00053  
00054  private:
00055   DelegationContext* get_delegcontext(Arc::Message& msg) const;
00056 
00057  public:
00058   DelegationSH(Arc::Config *cfg, Arc::ChainContext* ctx);
00059   virtual ~DelegationSH(void);
00060   static Arc::Plugin* get_sechandler(Arc::PluginArgument* arg);
00061   virtual bool Handle(Arc::Message* msg) const;
00062 };
00063 
00064 } // namespace ArcSec
00065 
00066 #endif /* __ARC_SEC_DELEGATIONSH_H__ */
00067