Skip to content

Commit

Permalink
Fix Timestamp issue, minor fix on test
Browse files Browse the repository at this point in the history
  • Loading branch information
pitbulk committed Jun 25, 2014
1 parent 3902ce3 commit 658d9a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion onelogin/saml/AuthRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def create(_clock=None, _uuid=None, _zlib=None, _base64=None,
# http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf Section
# 1.3.3
now = now.replace(microsecond=0)
now_iso = now.isoformat()
now_iso = now.isoformat() + 'Z'

unique_id = _uuid()
unique_id = unique_id.hex
Expand Down
4 changes: 1 addition & 3 deletions onelogin/saml/test/TestAuthRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ def fake_clock():
fake_zlib = fudge.Fake('zlib')
fake_zlib.remember_order()
fake_compress = fake_zlib.expects('compress')
fake_compress.with_args(
"""<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0" IssueInstant="2011-07-09T19:24:52" ID="hex_uuid" AssertionConsumerServiceURL="http://foo.bar/consume"><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">foo_issuer</saml:Issuer><samlp:NameIDPolicy AllowCreate="true" Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"/><samlp:RequestedAuthnContext Comparison="exact"><saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef></samlp:RequestedAuthnContext></samlp:AuthnRequest>"""
)
uncompressed_req = """<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Version="2.0" IssueInstant="2011-07-09T19:24:52" ID="hex_uuid" AssertionConsumerServiceURL="http://foo.bar/consume"><saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">foo_issuer</saml:Issuer><samlp:NameIDPolicy AllowCreate="true" Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"/><samlp:RequestedAuthnContext Comparison="exact"><saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef></samlp:RequestedAuthnContext></samlp:AuthnRequest>"""
fake_compress.returns('HDfoo_compressedCHCK')

fake_base64 = fudge.Fake('base64')
Expand Down

0 comments on commit 658d9a9

Please sign in to comment.