Skip to content

Commit 8924fc8

Browse files
committed
added original signature version of validateAssertion() for tests to be happy
1 parent e2cacd1 commit 8924fc8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

service_provider.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ func (sp *ServiceProvider) parseAssertion(assertionEl *etree.Element, checkFunct
10541054
return nil, err
10551055
}
10561056

1057-
if err := sp.validateAssertion(&assertion, checkFunction, now); err != nil {
1057+
if err := sp.validateAssertion2(&assertion, checkFunction, now); err != nil {
10581058
return nil, err
10591059
}
10601060

@@ -1065,7 +1065,11 @@ func (sp *ServiceProvider) parseAssertion(assertionEl *etree.Element, checkFunct
10651065
// the requirements to accept. If validation fails, it returns an error describing
10661066
// the failure. (The digital signature on the assertion is not checked -- this
10671067
// should be done before calling this function).
1068-
func (sp *ServiceProvider) validateAssertion(assertion *Assertion, checkFunction RequestIdCheckFunction, now time.Time) error {
1068+
func (sp *ServiceProvider) validateAssertion(assertion *Assertion, allowedRequestIds []string, now time.Time) error {
1069+
return sp.validateAssertion2(assertion, createDefaultChecker(allowedRequestIds), now)
1070+
}
1071+
1072+
func (sp *ServiceProvider) validateAssertion2(assertion *Assertion, checkFunction RequestIdCheckFunction, now time.Time) error {
10691073
if assertion.IssueInstant.Add(MaxIssueDelay).Before(now) {
10701074
return fmt.Errorf("expired on %s", assertion.IssueInstant.Add(MaxIssueDelay))
10711075
}

0 commit comments

Comments
 (0)