fix: STS xml was malformed (#4637)

This commit is contained in:
Chris Evett 2021-11-25 05:03:57 -05:00 committed by GitHub
parent 6376e15171
commit a2c6e00e22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -118,8 +118,7 @@ GET_SESSION_TOKEN_RESPONSE = """<GetSessionTokenResponse xmlns="https://sts.amaz
</GetSessionTokenResponse>"""
GET_FEDERATION_TOKEN_RESPONSE = """<GetFederationTokenResponse xmlns="https://sts.amazonaws.com/doc/
2011-06-15/">
GET_FEDERATION_TOKEN_RESPONSE = """<GetFederationTokenResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
<GetFederationTokenResult>
<Credentials>
<SessionToken>AQoDYXdzEPT//////////wEXAMPLEtc764bNrC9SAPBSM22wDOk4x4HIZ8j4FZTwdQWLWsKWHGBuFqwAeMicRXmxfpSPfIeoIYRqTflfKD8YUuwthAx7mSEI/qkPpKPi/kMcGdQrmGdeehM4IC1NtBmUpp2wUE8phUZampKsburEDy0KPkyQDYwT7WZ0wq5VSXDvp75YU9HFvlRd8Tx6q6fE8YQcHNVXAkiY9q6d+xo0rKwT38xVqr7ZD0u0iPPkUL64lIZbqBAz+scqKmlzm8FDrypNC9Yjc8fPOLn9FX9KSYvKTr4rvx3iSIlTJabIQwj2ICCR/oLxBA==</SessionToken>

View File

@ -36,3 +36,15 @@ def test_sts_get_caller_identity():
res.data.should.contain(b"Arn")
res.data.should.contain(b"UserId")
res.data.should.contain(b"Account")
def test_sts_wellformed_xml():
backend = server.create_backend_app("sts")
test_client = backend.test_client()
res = test_client.get("/?Action=GetFederationToken&Name=Bob")
res.data.should_not.contain(b"\n")
res = test_client.get("/?Action=GetSessionToken")
res.data.should_not.contain(b"\n")
res = test_client.get("/?Action=GetCallerIdentity")
res.data.should_not.contain(b"\n")