コード例 #1
0
ファイル: ConditionsTest.php プロジェクト: aarnaud/lightSAML
 public function test_get_first_proxy_restriction()
 {
     $conditions = new Conditions();
     $conditions->addItem(new AudienceRestriction());
     $conditions->addItem($expected = new ProxyRestriction());
     $conditions->addItem(new OneTimeUse());
     $conditions->addItem(new ProxyRestriction());
     $conditions->addItem(new AudienceRestriction());
     $actual = $conditions->getFirstProxyRestriction();
     $this->assertSame($expected, $actual);
 }
コード例 #2
0
 /**
  * @param AssertionContext $context
  *
  * @return void
  */
 protected function doExecute(AssertionContext $context)
 {
     $partyEntityDescriptor = $context->getProfileContext()->getPartyEntityDescriptor();
     $conditions = new Conditions();
     $conditions->setNotBefore($this->timeProvider->getTimestamp());
     $conditions->setNotOnOrAfter($conditions->getNotBeforeTimestamp() + $this->expirationSeconds);
     $audienceRestriction = new AudienceRestriction(array($partyEntityDescriptor->getEntityID()));
     $conditions->addItem($audienceRestriction);
     $context->getAssertion()->setConditions($conditions);
 }
コード例 #3
0
 protected function validateConditionsInterval(Conditions $conditions)
 {
     if ($conditions->getNotBeforeTimestamp() && $conditions->getNotOnOrAfterTimestamp() && $conditions->getNotBeforeTimestamp() > $conditions->getNotOnOrAfterTimestamp()) {
         throw new LightSamlValidationException('Conditions NotBefore MUST BE less than NotOnOrAfter');
     }
 }