From 8924fc8332bd3e6d08311a1a028670c620c4a6a5 Mon Sep 17 00:00:00 2001 From: Christopher Piggott Date: Fri, 29 Nov 2024 21:12:24 +0000 Subject: [PATCH] added original signature version of validateAssertion() for tests to be happy --- service_provider.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/service_provider.go b/service_provider.go index b6d87827..df584d79 100644 --- a/service_provider.go +++ b/service_provider.go @@ -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 } @@ -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)) }