Age | Commit message (Collapse) | Author |
|
Also cleaned up some nested attribute access.
|
|
Changing `%` style string formatters to `.format()`.
Leaving `logging` strings in old style for Python 2 compatibility.
Resolves: Issue #541
|
|
Fixes #405.
|
|
|
|
Resurrects #1.
|
|
|
|
Moved check into protected function _verify_time_range.
|
|
Moved check into protected function _check_audience.
|
|
Previous variables in verify_signed_jwt_with_certs did
not illustrate the actual use of each part.
|
|
|
|
Moved check into protected function _verify_signature.
|
|
Also defining the fallback pkcs12_key_as_pem as a top-level method
so that we may test it.
|
|
|
|
This is to address PEP8 E402 as in previous commit.
|
|
|
|
Simply ran
pep8ify -w oauth2client/
pep8ify -w tests/
|
|
|
|
Also making sure the _urlsafe_b64encode returns bytes
and updating dependent code with the change in
return type.
|
|
No longer needed since the cryptography 1.0 release has fixed
the slow import (due to changes in the way cffi was used).
|
|
Until now, code that depended on PyCrypto or OpenSSL was
defined conditionally (e.g. indented) in `crypt.py`. Rather than
grouping all these together, we factor out the library specific
behavior into standalone modules (but make the modules
private / protected).
In addition, added a `_helpers.py` module with common behavior
that was previously defined in multiple places.
Finally, beefed up some test cases so that the three newly added
modules had 100% test coverage.
Towards #212.
|
|
Also
- Removing bare `except:` statements in both the PyCrypto and
OpenSSL verifiers (in the `verify` method).
- Catching the only exception possible in the OpenSSL verifier
(it is `OpenSSL.crypto.Error`).
- Converting the signature to bytes (if not already) in the
OpenSSL verifier.
- Adding a test with both a unicode and bytes signature for
each verifier.
Fixes #201.
|
|
Previously, we assumed that anyone using `OpenSSL` would have installed it via
a mechanism like `pip`; this has come back to bite us.
We modify our code to look for `OpenSSL.crypto`, not just `OpenSSL`, and add
another (unpleasant) test.
Fixes #190.
|
|
Previously, we'd attempted to detect OpenSSL without actually importing, in
order to avoid a runtime penalty for importing `oauth2client`. However, in
some exotic situations, `imp.find_module` can fail even though the import
would be successful.
We tweak to fall back to importing, and add some gross to the corresponding
test.
|
|
Previously, when confirming OpenSSL is installed, we checked that the module
was installed, and verified that `crypto.py` was contained in the package
directory.
However, this can cause issues in cases of non-standard installs. In addition,
the `imp.find_module` call already raises an `ImportError` in the case that
the module is missing, so this second check isn't needed.
Instead, we just drop the explicit check for `crypto.py` in the `OpenSSL`
directory.
|
|
This is to speed up import times. In OpenSSL 0.14 the import takes
0.5 seconds due to cffi on-demand build of extensions in the
cryptography library.
For classes and functions which are conditionally defined based on
the existence of OpenSSL.crypto, we check that the module
exists (but don't import it) using imp.find_module.
|
|
Also only defining if OpenSSL is installed and conditionally
defining a method which raises NotImplementedError if not
defined.
|
|
|
|
|
|
Conflicts:
oauth2client/client.py
|
|
|
|
This mostly cleans up a few lint errors, normalizes some formatting and import
order, etc. I'm not yet attempting to make things lint clean, just making some
progress.
I also fixed one error with a `simplejson` call that didn't get renamed.
|
|
|
|
modified: oauth2client/crypt.py
|
|
|
|
|
|
|
|
Conflicts:
oauth2client/client.py
oauth2client/clientsecrets.py
oauth2client/crypt.py
oauth2client/file.py
oauth2client/gce.py
oauth2client/multistore_file.py
oauth2client/service_account.py
oauth2client/tools.py
oauth2client/util.py
tests/test_jwt.py
tests/test_oauth2client.py
tests/test_service_account.py
uritemplate/__init__.py
|
|
|
|
|
|
This is mostly a cleanup around import statements and a few related pylint
issues.
|
|
* Set the minimum version of python to be 2.6, since we don't need to support
anything older anymore.
* As the first of a series of related cleanups, drop our custom json
module (since json is in the stdlib since 2.6).
|
|
The load_pkcs12 can't handle passing unicode objects. Instead, encode the given
string as bytes before passing to the function.
|
|
|
|
|
|
|
|
Major change in load_pkcs12:
0.13: Need str
0.14: Need bytes
|
|
|
|
|
|
|
|
|