• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

spulec / moto / 7298
95%

Build:
DEFAULT BRANCH: master
Ran 08 Dec 2020 09:44AM UTC
Jobs 8
Files 422
Run time 79min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
7298

push

travis-ci

web-flow
Fix saml-assertion parsing in assume-role-with-saml (#3523)

* Retrieve SAML Attribute by Name instead of relying on order which is too fragile

* Handle case when SAML Attribute SessionDuration is not provided, as it is not a required attribute from SAML response

When session duration not provided, AWS consider by default a duration of one hour as cited in the following documentation:
"If this attribute is not present, then the credential last for one hour (the default value of the DurationSeconds parameter of the AssumeRoleWithSAML API)."
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_assertions.html#saml_role-session-duration

Traceback was:
[...]
  File "/Users/benjamin.brabant/Projects/PERSO/moto/moto/sts/responses.py", line 79, in assume_role_with_saml
    role = sts_backend.assume_role_with_saml(
  File "/Users/benjamin.brabant/Projects/PERSO/moto/moto/sts/models.py", line 99, in assume_role_with_saml
    role = AssumedRole(**kwargs)
TypeError: __init__() missing 1 required positional argument: 'duration'

* Process saml xml namespaces properly instead of relying on textual prefix that can vary between identity providers

* Handle when SAML response AttributeValue xml tag contains attributes that force xmltodict to build a dictionary as for complex types instead of directly returning string value

Leverage force_cdata option of xmltodict parser that always return a complex dictionary even if xml tag contains only text and no attributes.

* Improve existing test_assume_role_with_saml to be coherent with other assume_role_with_saml tests and remove dead code at the same time

11 of 11 new or added lines in 2 files covered. (100.0%)

42848 of 45336 relevant lines covered (94.51%)

5.97 hits per line

Jobs
ID Job ID Ran Files Coverage
1 7298.1 (TEST_SERVER_MODE=false) 08 Dec 2020 09:54AM UTC 0
94.3
Travis Job 7298.1
2 7298.2 (TEST_SERVER_MODE=true) 08 Dec 2020 10:13AM UTC 0
53.75
Travis Job 7298.2
3 7298.3 (TEST_SERVER_MODE=false) 08 Dec 2020 09:44AM UTC 0
94.27
Travis Job 7298.3
4 7298.4 (TEST_SERVER_MODE=true) 08 Dec 2020 09:57AM UTC 0
55.39
Travis Job 7298.4
5 7298.5 (TEST_SERVER_MODE=false) 08 Dec 2020 10:21AM UTC 0
94.26
Travis Job 7298.5
6 7298.6 (TEST_SERVER_MODE=true) 08 Dec 2020 10:44AM UTC 0
55.38
Travis Job 7298.6
7 7298.7 (TEST_SERVER_MODE=false) 08 Dec 2020 10:35AM UTC 0
94.37
Travis Job 7298.7
8 7298.8 (TEST_SERVER_MODE=true) 08 Dec 2020 11:02AM UTC 0
56.23
Travis Job 7298.8
Source Files on build 7298
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #7298
  • 7c7a1222 on github
  • Prev Build on master (#7297)
  • Next Build on master (#7299)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc