Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Update expiry dates for responses #269

Merged
merged 1 commit into from Jul 5, 2021

Conversation

zhaofengli
Copy link
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
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.

None yet

2 participants