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

Correct provisioning_uri method's output #33

Merged
merged 3 commits into from Aug 16, 2016
Merged

Conversation

baco
Copy link

@baco baco commented Aug 15, 2016

Added to the provisioning_uri method in HOTP and TOTP classes the
ability to call the util's function build_uri with all the necessary
arguments.

Added to the function build_uri the ability to handle values different
than the defaults for algorithm, digits and period when generating URI.

Closes #32

Added to the provisioning_uri method in HOTP and TOTP classes the
ability to call the util's function build_uri with all the necessary
arguments.

Added to the function build_uri the ability to handle values different
than the defaults for algorithm, digits and period when generating URI.
@kislyuk
Copy link
Member

kislyuk commented Aug 15, 2016

Please fix the lint error.

@kislyuk
Copy link
Member

kislyuk commented Aug 15, 2016

Also, please add a test case exercising the new options and asserting on the output.

Made some corrections to pass the standard PEP-008 in all files.
Corrected lint errors in docstring in utils' function build_uri. Also
corrected an import error for python 2.x and indentation error in utils
module.
@codecov-io
Copy link

codecov-io commented Aug 16, 2016

Current coverage is 39.44% (diff: 70.58%)

Merging #33 into master will not change coverage

@@             master        #33   diff @@
==========================================
  Files             2          2          
  Lines           109        109          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits             43         43          
  Misses           66         66          
  Partials          0          0          

Powered by Codecov. Last update d6105af...8faf7b7

@baco
Copy link
Author

baco commented Aug 16, 2016

I will have tests done soon, but since I am using urlencode method to build URL query params and dicts don't have strict elemets order, comparing bare strings is not enough.

Added the corresponding tests for the new URI generated parameters for
both, HOTP and TOTP algorithms. Some earlier tests had to be reformed
because now the URI parameters are encoded using urlencode instead of
concatenating strings. The string generated by urlencode comes from a
dictionary and dictionary items do not have a predefined order.

Also corrected some PEP-008 issues.
@baco
Copy link
Author

baco commented Aug 16, 2016

Done.

@kislyuk kislyuk merged commit 6cedd88 into pyauth:master Aug 16, 2016
@kislyuk
Copy link
Member

kislyuk commented Aug 16, 2016

Great work, thank you.

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

3 participants