Skip to content

tests: Update expiry dates for responses#269

Merged
pitbulk merged 1 commit intoSAML-Toolkits:masterfrom
zhaofengli:update-expiry
Jul 5, 2021
Merged

tests: Update expiry dates for responses#269
pitbulk merged 1 commit intoSAML-Toolkits:masterfrom
zhaofengli:update-expiry

Conversation

@zhaofengli
Copy link
Copy Markdown
Contributor

The following test inputs have NotOnOrAfter values that are expired:

./responses/unsigned_response_with_miliseconds.xm.base64
./responses/no_audience.xml.base64
./responses/invalids/invalid_subjectconfirmation_noa.xml.base64
./responses/invalids/response_encrypted_attrs.xml.base64
./responses/invalids/invalid_issuer_assertion.xml.base64
./responses/invalids/no_subjectconfirmation_data.xml.base64
./responses/invalids/invalid_audience.xml.base64
./responses/invalids/invalid_subjectconfirmation_inresponse.xml.base64
./responses/invalids/no_nameid.xml.base64
./responses/invalids/invalid_subjectconfirmation_recipient.xml.base64
./responses/invalids/invalid_issuer_message.xml.base64
./responses/invalids/encrypted_attrs.xml.base64
./responses/invalids/invalid_sessionindex.xml.base64
./responses/invalids/no_subjectconfirmation_method.xml.base64

They are causing errors in tests like:

======================================================================
FAIL: testIsInValidSubjectConfirmation (tests.src.OneLogin.saml2_tests.response_test.OneLogin_Saml2_Response_Test)
Tests the is_valid method of the OneLogin_Saml2_Response class
----------------------------------------------------------------------
onelogin.saml2.errors.OneLogin_Saml2_ValidationError: Could not validate timestamp: expired. Check system clock.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/source/tests/src/OneLogin/saml2_tests/response_test.py", line 1311, in testIsInValidSubjectConfirmation
    response.is_valid(request_data, raise_exceptions=True)
AssertionError: "A valid SubjectConfirmation was not found on this Response" does not match "Could not validate timestamp: expired. Check system clock."

Ugly one-liner that created this patch:

find . -name '*.base64' -exec sh -c "base64 -d {} | if grep 2021-06 > /dev/null; then echo {}; base64 -d {} | sed s/2021/2099/g | base64 -w 0 | sponge {}; fi " \;

@pitbulk
Copy link
Copy Markdown
Contributor

pitbulk commented Jul 5, 2021

Thanks for taking the time updating those files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants