Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Getting to 100% coverage for crypt module. #290

Merged
merged 8 commits into from
Sep 1, 2015

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Aug 26, 2015

I also re-factored the module a bit since the code was opaque and there was too much going on in one method.

@dhermes dhermes mentioned this pull request Aug 26, 2015
52 tasks
@dhermes dhermes force-pushed the 100-percent-coverage-crypt branch from 472d71d to 8c8074d Compare August 26, 2015 01:46
@dhermes
Copy link
Contributor Author

dhermes commented Aug 27, 2015

@nathanielmanistaatgoogle FYI

@nathanielmanistaatgoogle
Copy link
Contributor

I intend to get to this but won't until the weekend.

@dhermes
Copy link
Contributor Author

dhermes commented Aug 27, 2015

No worries just wanted to make sure it was still on your radar.

@nathanielmanistaatgoogle
Copy link
Contributor

Just the one comment on the second of the seven commits.

@@ -95,7 +97,108 @@ def make_signed_jwt(signer, payload):
return b'.'.join(segments)


def verify_signed_jwt_with_certs(jwt, certs, audience):
def _verify_signature(message, signature, certs):

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Also defining the fallback pkcs12_key_as_pem as a top-level method
so that we may test it.
Moved check into protected function _verify_signature.
Previous variables in verify_signed_jwt_with_certs did
not illustrate the actual use of each part.
Moved check into protected function _check_audience.
Moved check into protected function _verify_time_range.
This already exists in test_jwt but these tests just make sure
the correct exceptions occur on error and make sure that in the
success case all the correct verify/check methods are called.
Doesn't actually call these methods, just uses mocks instead.
@dhermes dhermes force-pushed the 100-percent-coverage-crypt branch from 8c8074d to ef4d070 Compare September 1, 2015 17:11
Args:
message: string or bytes, The message to verify.
signature: string or bytes, The signature on the message.
cert_list: list, certificates in PEM format.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@nathanielmanistaatgoogle
Copy link
Contributor

I would never request a change to a public function signature in a refactoring pull request. :-) At least not accidentally. Private functions are totally fair game.

@dhermes dhermes force-pushed the 100-percent-coverage-crypt branch from ef4d070 to 3f9b592 Compare September 1, 2015 18:25
@dhermes
Copy link
Contributor Author

dhermes commented Sep 1, 2015

@nathanielmanistaatgoogle pushed the rename.

It seems you don't really care about the AppIdentityError since you keep ignoring my replies about it 😀

@nathanielmanistaatgoogle
Copy link
Contributor

It's fine to punt on AppIdentityError to a later time when you address what you "dislike [about] the way exceptions are used in this library". :-)

The commit log message of 3f9b592 could use correction.

@dhermes
Copy link
Contributor Author

dhermes commented Sep 1, 2015

Correction from list to iterable or something else?

@nathanielmanistaatgoogle
Copy link
Contributor

Yes, just "iterable" in the commit log message.

@dhermes dhermes force-pushed the 100-percent-coverage-crypt branch from 3f9b592 to dcefaad Compare September 1, 2015 18:32
@dhermes
Copy link
Contributor Author

dhermes commented Sep 1, 2015

OK cool. Updated the code and the commit message.

I can wait on Travis to merge if it LGTY.

@nathanielmanistaatgoogle
Copy link
Contributor

Looks good; merge at will and thanks for the discussion.

dhermes added a commit that referenced this pull request Sep 1, 2015
Getting to 100% coverage for crypt module.
@dhermes dhermes merged commit 19abb4d into googleapis:master Sep 1, 2015
@dhermes dhermes deleted the 100-percent-coverage-crypt branch September 1, 2015 19:56
@dhermes dhermes mentioned this pull request Sep 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants