X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=blobdiff_plain;f=saml%2Fbinding%2FSecurityPolicy.h;h=b655d01e478a6621e2ed0e5dd334f33338f63eed;hp=72d24643028f92aad7741e482d777878b9f5207a;hb=c3cd4ec3fa87d0ad3c6f65c1a5e15f548b1b6cc2;hpb=1d5fda59e4996860bb2480ad52e29b2160d04725 diff --git a/saml/binding/SecurityPolicy.h b/saml/binding/SecurityPolicy.h index 72d2464..b655d01 100644 --- a/saml/binding/SecurityPolicy.h +++ b/saml/binding/SecurityPolicy.h @@ -70,11 +70,7 @@ namespace opensaml { const xmltooling::QName* role=NULL, const xmltooling::TrustEngine* trustEngine=NULL, bool validate=true - ) : m_metadataCriteria(NULL), m_messageID(NULL), m_issueInstant(0), m_issuer(NULL), m_issuerRole(NULL), m_authenticated(false), - m_matchingPolicy(NULL), m_metadata(metadataProvider), m_role(NULL), m_trust(trustEngine), m_validate(validate), m_entityOnly(true) { - if (role) - m_role = new xmltooling::QName(*role); - } + ); virtual ~SecurityPolicy(); @@ -135,6 +131,26 @@ namespace opensaml { } /** + * Returns the entityID of the receiving entity. + * + * @return entityID of the peer processing the message + */ + const XMLCh* getRecipient() { + return m_recipient; + } + + /** + * Gets the effective time of message processing. + * + * @return the time at which the message is being processed + */ + time_t getTime() { + if (m_ts == 0) + return m_ts = time(NULL); + return m_ts; + } + + /** * Gets a mutable array of installed policy rules. * *

If adding rules, their lifetime must be at least as long as the policy object. @@ -205,6 +221,27 @@ namespace opensaml { } /** + * Sets entityID of receiving entity. + * + * @param recipient the entityID of the peer processing the message + */ + void setRecipient(const XMLCh* recipient) { + m_recipient = recipient; + } + + /** + * Sets effective time of message processing. + * + *

Assumed to be the time of policy instantiation, can be adjusted to pre- or post-date + * message processing. + * + * @param ts the time at which the message is being processed + */ + void setTime(time_t ts) { + m_ts = ts; + } + + /** * Evaluates the policy against the given request and message, * possibly populating message information in the policy object. * @@ -410,6 +447,10 @@ namespace opensaml { const xmltooling::TrustEngine* m_trust; bool m_validate; bool m_entityOnly; + + // contextual information + const XMLCh* m_recipient; + time_t m_ts; }; };