Skip to content

Commit

Permalink
added original signature version of validateAssertion() for tests to …
Browse files Browse the repository at this point in the history
…be happy
  • Loading branch information
wz2b committed Nov 29, 2024
1 parent e2cacd1 commit 8924fc8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ func (sp *ServiceProvider) parseAssertion(assertionEl *etree.Element, checkFunct
return nil, err
}

if err := sp.validateAssertion(&assertion, checkFunction, now); err != nil {
if err := sp.validateAssertion2(&assertion, checkFunction, now); err != nil {
return nil, err
}

Expand All @@ -1065,7 +1065,11 @@ func (sp *ServiceProvider) parseAssertion(assertionEl *etree.Element, checkFunct
// the requirements to accept. If validation fails, it returns an error describing
// the failure. (The digital signature on the assertion is not checked -- this
// should be done before calling this function).
func (sp *ServiceProvider) validateAssertion(assertion *Assertion, checkFunction RequestIdCheckFunction, now time.Time) error {
func (sp *ServiceProvider) validateAssertion(assertion *Assertion, allowedRequestIds []string, now time.Time) error {
return sp.validateAssertion2(assertion, createDefaultChecker(allowedRequestIds), now)
}

func (sp *ServiceProvider) validateAssertion2(assertion *Assertion, checkFunction RequestIdCheckFunction, now time.Time) error {
if assertion.IssueInstant.Add(MaxIssueDelay).Before(now) {
return fmt.Errorf("expired on %s", assertion.IssueInstant.Add(MaxIssueDelay))
}
Expand Down

0 comments on commit 8924fc8

Please sign in to comment.