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

Switch to google-auth lib for authentication (bug 1864638) #252

Merged
merged 3 commits into from
Nov 17, 2023

Conversation

jcristau
Copy link
Contributor

@jcristau jcristau commented Oct 26, 2023

This is not backwards-compatible: we now require the service account credentials in json format instead of pkcs12.

Fixes #251

@jcristau jcristau changed the title WIP - Switch to google-auth lib for authentication Switch to google-auth lib for authentication Oct 27, 2023
@jcristau jcristau force-pushed the google-auth branch 2 times, most recently from 37aff6d to 5ed8065 Compare October 31, 2023 10:36
@jcristau jcristau marked this pull request as ready for review October 31, 2023 10:39
Copy link
Contributor

@JohanLorenzo JohanLorenzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! I love the new authentication mechanism.


### Changed
* Removed support for pushing to the Amazon store.
* Switched Google Play Store authentication to the google-auth library. The credentials now need to be passed as a json file instead of an email address and PKCS#12 file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment on lines -40 to -49
1. Some errors might happen when executing `mozapkpublisher/push_apk.py`
1. You might have errors like
* Errors in from_p12_keyfile in oauth2client/service_account.py or
* ImportError: cannot import name `_openssl_crypt`
* `pip uninstall oauth2client`
* `pip install oauth2client==2.0.0`
* `pip install google-api-python-client==1.5.0`
1. Symbol not found: `_BIO_new_CMS`
* `pip uninstall cryptography`
* `LDFLAGS="-L/usr/local/opt/openssl/lib" pip install cryptography --no-use-wheel`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see these lines gone

1. Execute the steps defined in the section above.
1. Download the latest signed builds. For instance, for Fennec Nightly: `./mozapkpublisher/get_apk.py --latest-nightly`
1.
```sh
./mozapkpublisher/push_apk.py --no-gp-string-update --track beta --credentials /path/to/your/googleplay/creds.p12 --service-account [email protected] x86.apk arm.apk
./mozapkpublisher/push_apk.py --no-gp-string-update --track beta --credentials /path/to/your/googleplay/creds.json x86.apk arm.apk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much cleaner!

credentials_file_name,
scopes=scope
scopes=[scope],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines -28 to -29
CLIENT_ID = 'client'
CLIENT_SECRET = 'secret'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning up these unused variable. I don't remember why they were here in the first place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were part of the amazon code, and should have been removed in #253.

humanize
mozilla-version
oauth2client
pyOpenSSL # Even not imported once in mozapkpublisher, it's needed to open p12 files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this comment is not needed anymore.

mozapkpublisher/common/utils.py Outdated Show resolved Hide resolved
This is not backwards-compatible: we now require the service account
credentials in json format instead of PKCS#12 (and as a result the
username is no longer passed separately, since it is directly available
in the json file)

Fixes mozilla-releng#251
@jcristau jcristau changed the title Switch to google-auth lib for authentication Switch to google-auth lib for authentication (bug 1864638) Nov 14, 2023
@jcristau jcristau merged commit 4bf816c into mozilla-releng:master Nov 17, 2023
4 checks passed
@jcristau jcristau deleted the google-auth branch November 17, 2023 16:22
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.

move away from oauth2client
3 participants