Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

replace-ascii-parsing-with-utf-8 #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

replace-ascii-parsing-with-utf-8 #30

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 14, 2019

Issue: When attempting login and return token for aws with adfs the program produces this error:

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/awsprocesscreds/saml.py", line 423, in _parse_roles root = ET.fromstring(base64.b64decode(assertion).decode('ascii')) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10504: ordinal not in range(128)

When passed credentials containing only ascii characters. Further inspection revealed if a user has 17 roles the login fails with above error. Normal login works as expected.

Description of changes:

Changed decoding from ascii to utf-8. Issue was resolved.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-io
Copy link

Codecov Report

Merging #30 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #30   +/-   ##
======================================
  Coverage    98.1%   98.1%           
======================================
  Files           5       5           
  Lines         317     317           
  Branches       42      42           
======================================
  Hits          311     311           
  Misses          3       3           
  Partials        3       3
Impacted Files Coverage Δ
awsprocesscreds/saml.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a216e70...6ed7fc6. Read the comment docs.

@ericdbarry
Copy link

Hey, I am not a maintainer - just someone trying to make this work, but I noticed there were other instances - all tests - that use this as well and this patch should probably fix them too:

https://github.com/awslabs/awsprocesscreds/search?q=ascii&unscoped_q=ascii

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants