-
Notifications
You must be signed in to change notification settings - Fork 1
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
PT-1 ability to generate provisioning urls #1
Merged
darrenedale
merged 9 commits into
main
from
PT-1-ability-to-generate-provisioning-ur-ls
Apr 22, 2022
Merged
PT-1 ability to generate provisioning urls #1
darrenedale
merged 9 commits into
main
from
PT-1-ability-to-generate-provisioning-ur-ls
Apr 22, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- added UrlGenerator class - added UrlGeneratorException exception base class - added InvalidRendererException to be thrown when the UrlGenerator is configured to emit the number of digits but the renderer is not an IntegerRenderer
- added UrlGenerator class - added UrlGeneratorException exception base class - added InvalidRendererException to be thrown when the UrlGenerator is configured to emit the number of digits but the renderer is not an IntegerRenderer
- added helper to generate anonymous Stringable objects with specified strings
- updated existing unit tests to use the helper to create Stringables rather than repeating boilerplate - renamed EightDigitTest for consistency and correct naming convention - all unit tests declare strict_types=1
- updated namespace for unit tests. - added testsuite for renderers. - moved all test code that is not a test case (e.g. constraints, test case base class) into ...\Framework namespace for clearer separation
- UrlGenerator class generates URLs of the form: otpauth://totp/[{issuer}:]{user}/?secret={secret}[&digits={digits}][&algorithm={algorithm}][&period={period}][&issuer={issuer}] - user and secret are mandatory - Url generator can be configured to: - show digits always/never/only when set to non-default - show period always/never/only when set to non-default - show algorithm always/never/only when set to non-default - have or not have an issuer - updated README.md to include examples of provisioning using the UrlGenerator - added exceptions (and common base class) for situations where an UrlGenerator is given incompatible data to work with: - InvalidUserException is thrown when an empty user is given to an UrlGenerator instance or when an attempt is made to generate the URL without first having set the user - UnsupportedRendererException is thrown when the digits URL parameter is set to always be generated but the Totp renderer is not an IntegerRenderer - added unit tests for UrlGenerator with full coverage - added test-time exceptions to report problems with defined test data - added constraint to test equivalence of generated URLs (in essence it allows for different ordering of URL parameters as long as the parameters and values themselves are identical
…oning-ur-ls' into PT-1-ability-to-generate-provisioning-ur-ls # Conflicts: # src/UrlGenerator.php
- removed redundant InvalidRendererException (the actual exception class is UnsupportedRendererException).- removed redundant UrlGeneratorException (the actual exception class is in the Exceptions/UrlGenerator/ subdirectory). - added class docs where missing for UrlGenerator exceptions - added docs for EquivalentOtpAuthUrl constraint - added class docs for TestCase base class - added class docs for Integer-based Renderer test cases.
- several files missing newline at end of file - switched out tab characters for spaces in some files
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added UrlGenerator class to ... generate URLs
otpauth://totp/[{issuer}:]{user}/?secret={secret}[&digits={digits}][&algorithm={algorithm}][&period={period}][&issuer={issuer}]
- show digits always/never/only when set to non-default
- show period always/never/only when set to non-default
- show algorithm always/never/only when set to non-default
- have or not have an issuer
- InvalidUserException is thrown when an empty user is given to an UrlGenerator instance or when an attempt is made to generate the URL without first having set the user
- UnsupportedRendererException is thrown when the digits URL parameter is set to always be generated but the Totp renderer is not an IntegerRenderer