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

Merge develop for version 1.2.1 #11

Merged
merged 14 commits into from
Mar 6, 2021
Merged

Merge develop for version 1.2.1 #11

merged 14 commits into from
Mar 6, 2021

Conversation

DontPanicO
Copy link
Owner

Merging develop branch for new release

DontPanicO and others added 14 commits February 19, 2021 15:25
Before this commit, passing a non existing file to --self.path_to_key resulted in a FileNotFoundError. This has been now handled
Since the deprecation status of complex_payload method, a warning about it has been placed in the code, spawning when users call that method. It was placed in a for loop so the warning spawned as many times as complex_payload was called. It now has been moved outside the for loop
Preceding the new feature token_only --token-only, that it's going to ignore warnings and other infos, printing out only the generated JWT, a method called ifprint has been defined. It takes two parameter: condition and string. If condition is true, the function prints out string. So we can pass the new option token_only as condition to determine what to print. In our secific case the condition has to be passed as negative (not <condition>)
Added the option --quiet for conditional printing, and applied it wherever it's possible. It's not been applied to errors, since triggering an error users have no need of a quiet mode. This can be changed later
Implemented a method to convert pem format items to der ones. Implemented also a dissect_token method, that split a token in two parts; the original message and the signature. This is also in prevision of a new functionality that's going to be introduced with next releases.
In order to avoid the user having to spiecify the algortihm during a token verification, a method to extract the alg from the original base64 encoded JWT header. This is due since during validation we can't access the token dictionary (the dictionarize_token method is called after validation is done and we can't do it before, or we can run through errors since token has not been validated yet). Using this function cuold sound a bit of repetitive, the only alternative is to declare the variables containing the splitted and decoded token information in the init method, before validation run, and than initialize them during validation. Anyway this will require an extra step, casting those infomration to dict type, that's not included in the current process. Last, a new important feature is going to be implemented with next releases, that will make use of this new method too
…user to specify an algorithm

Since now, verifying operations, required the user to specify an algorithm. This was not the way since, in order to perform a reliable verification, every change in the token should be ignored. After some test, this is going to be extended to the find_verifier_key_from_jwks_and_quit method too
Now finding verifier key from a jwks file does not required the user to specifying an algorithm anymore
@DontPanicO DontPanicO self-assigned this Mar 6, 2021
@DontPanicO DontPanicO linked an issue Mar 6, 2021 that may be closed by this pull request
@DontPanicO DontPanicO merged commit 9bec910 into main Mar 6, 2021
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.

FileNotFoundError when passing non existing key file to -k/--key
1 participant