Uh oh!
There was an error while loading. Please reload this page.
Swapping PyCrypto for pyOpenSSL. - #1338
Conversation
dhermes
commented
Jan 2, 2016
To "confirm" this implementation matches our current one I did the following: >>>importjson>>>fromoauth2client.clientimportGoogleCredentials>>>fromOpenSSLimportcrypto>>>fromgcloudimportcredentials>>>creds=GoogleCredentials.get_application_default() # Env. var. -> path to JSON key>>>pkey=crypto.load_privatekey(crypto.FILETYPE_PEM, creds._private_key_pkcs8_text)
>>>data=b'foo'>>>new_signed_bytes=crypto.sign(pkey, data, 'SHA256')
>>>curr_signed_bytes=credentials._get_signature_bytes(creds, data)
>>>new_signed_bytes==curr_signed_bytesTrue |
dhermes
commented
Jan 2, 2016
H/T to @tseaver for pointing out that |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was done because PyCrypto does not install easily on Windows. pyOpenSSL is managed by PyCA (the Python crypto authority) and has a mature release process. This change was influenced by discussions about googleapis#1009.
dhermes
commented
Jan 7, 2016
@jonparrott Is |
theacodes
commented
Jan 7, 2016
I don't think so; only |
dhermes
commented
Jan 7, 2016
OK. It may be best to take the |
theacodes
commented
Jan 7, 2016
Sounds reasonable. |
tseaver
commented
Jan 7, 2016
I'd really hate to have our codebase cluttered with both the current |
dhermes
commented
Jan 7, 2016
Maybe now is the time to bite the bullet and get both implementations into Then the question becomes
|
tseaver
commented
Jan 7, 2016
I really don't want to introduce imperative platform-based variations in the requirements (breaking wheel generation, for instance). Is there a PEP 508-supported way to detect GAE? |
theacodes
commented
Jan 7, 2016
No. |
dhermes
commented
Jan 7, 2016
@jonparrott Wrote https://github.com/jonparrott/Darth-Vendor which probably makes him the foremost expert on packaging for GAE 😀 |
dhermes
commented
Jan 8, 2016
@jonparrott After some digging I realized this can be done in pure Python using |
theacodes
commented
Jan 8, 2016
@dhermes if they have any native components, then yes. Let me verify. |
theacodes
commented
Jan 8, 2016
@dhermes those should be fine. Go for it. 👍 |
dhermes
commented
Jan 8, 2016
Good deal. Thanks for doing it for me (I know I could've RTFM instead of wasting your time). |
theacodes
commented
Jan 8, 2016
Considering how much of your time I've monopolized elsewhere, I'd say I owe you. |
dhermes
commented
Jan 8, 2016
As I was starting to do the @jonparrott What does darth vendor do if a package can't be installed / imported in GAE? |
theacodes
commented
Jan 8, 2016
@dhermes nothing. pip handles the installation, not the vendor tool. Pip will happily stage a binary package into the |
dhermes
commented
Jan 8, 2016
OK. I suppose we could |
tseaver
commented
Jan 14, 2016
Would the |
dhermes
commented
Jan 14, 2016
What did you have in mind? i.e. Try and except what import? How would it help GAE? |
tseaver
commented
Jan 14, 2016
I'm responding to:
|
dhermes
commented
Jan 14, 2016
I meant |
theacodes
commented
Jan 14, 2016
|
dhermes
commented
Jan 14, 2016
@jonparrott Do you think it's fine to just leave |
theacodes
commented
Jan 14, 2016
I think you're in the clear as long as you don't ever try to use the library within GAE code. |
dhermes
commented
Jan 14, 2016
@tseaver GAE is "no longer" a blocker for using |
tseaver
commented
Jan 14, 2016
I thought GAE was the only reason to keep the |
dhermes
commented
Jan 14, 2016
Nope its Windows. Check out the description of this PR. |
dhermes
commented
Jan 14, 2016
I just scared myself into thinking that it'd be a blocker for GAE but forgot that GAE and GCE had custom credentials types |
tseaver
commented
Jan 14, 2016
Oops, I misspoke: I meant I thought the old codepath ( |
dhermes
commented
Jan 14, 2016
Got it. All good to merge? (PS I am planning on pushing this upstream to |
tseaver
commented
Jan 14, 2016
LGTM. I had lost track of the fact that you already dropped the old codepath. |
Swapping PyCrypto for pyOpenSSL.
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Source-Link: googleapis/synthtool@56da63e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:993a058718e84a82fda04c3177e58f0a43281a996c7c395e0a56ccc4d6d210d7
* feat: support fine-grained permissions database roles in connect Add an optional `database_role` argument to `connect` for supplying the database role to connect as when using [fine-grained access controls](https://cloud.google.com/spanner/docs/access-with-fgac) * feat: support fine-grained permissions database roles in connect Add an optional `database_role` argument to `connect` for supplying the database role to connect as when using [fine-grained access controls](https://cloud.google.com/spanner/docs/access-with-fgac) * add missing newline to code block --------- Co-authored-by: Knut Olav Løite <koloite@gmail.com>
This was done because
PyCryptodoes not install easily on Windows.pyOpenSSLis managed by PyCA (the Python crypto authority) and has a mature release process.This change was influenced by discussions about #1009.