Package: pyramid-googleauth
pyramid-googleauth'Sign in with Google' for Pyramid.UsageTo use pyramid-googleauth with your Pyramid app:1. Create a Google client ID and secretRegister a Google OAuth client:Create a newGoogle Cloud Platform project.Go tohttps://console.cloud.google.com/projectcreateand create a new project,
or use an existing Google Cloud Platform project.Configure the project'sOAuth consent screensettings:Go tohttps://console.cloud.google.com/apis/credentials/consentand make sure the correct project is selected from the projects
dropdown menu in the top left.UnderUser TypeselectInternaland then clickCREATE.Note thatInternalmeans that only users within the Google
organization that contains the project will be able to log in.
If you wantanyoneto be able to log in to your app with their
Google account you have to selectExternal.Fill out the app name, user support email and other fields and clickSAVE AND CONTINUE.On theScopesscreen clickADD OR REMOVE SCOPES,
select the..auth/userinfo.email,..auth/userinfo.profileandopenidscopes,
and clickUPDATEandSAVE AND CONTINUE.Configure the project'sCredentialssettings:Go tohttps://console.cloud.google.com/apis/credentialsand make sure the correct project is selected from the projects
dropdown menu in the top left.ClickCREATE CREDENTIALS→OAuth client ID.UnderApplication typeselectWeb application.Enter aName.UnderAuthorized redirect URIsclickADD URIand enterhttps://<YOUR_DOMAIN>/googleauth/login/callback.ClickCREATE.Note theClient IDandClient Secretthat are created for you.
You'll need to use these for thepyramid_googleauth.google_client_idandpyramid_googleauth.google_client_secretsettings in your app.2. Add pyramid-googleauth to your Pyramid appAddpyramid-googleauthto
your app's Python requirements.Add pyramid-googleauth to your app's code:Your app needs to set a session factory, a security policy, and a handful of
pyramid-googleauth settings, before doingconfig.include("pyramid-googleauth").
Seethe example appfor a working example to copy from.Setting up Your pyramid-googleauth Development EnvironmentFirst you'll need to install:Git.
On Ubuntu:sudo apt install git, on macOS:brew install git.GNU Make.
This is probably already installed, runmake --versionto check.pyenv.
Follow the instructions in pyenv's README to install it.
TheHomebrewmethod works best on macOS.
TheBasic GitHub Checkoutmethod works best on Ubuntu.
Youdon'tneed to set up pyenv's shell integration ("shims"), you canuse pyenv without shims.Then to set up your development environment:git clone https://github.com/hypothesis/pyramid-googleauth.git
cd pyramid_googleauth
make helpReleasing a New Version of the ProjectFirst, to get PyPI publishing working you need to go to:https://github.com/organizations/hypothesis/settings/secrets/actions/PYPI_TOKENand add pyramid-googleauth to thePYPI_TOKENsecret's selected
repositories.Now that the pyramid-googleauth project has access to thePYPI_TOKENsecret
you can release a new version by justcreating a new GitHub release.
Publishing a new GitHub release will automatically triggera GitHub Actions workflowthat will build the new version of your Python package and upload it tohttps://pypi.org/project/pyramid-googleauth.Changing the Project's Python VersionsTo change what versions of Python the project uses:Change the Python versions in thecookiecutter.jsonfile. For example:"python_versions":"3.10.4, 3.9.12",Re-run the cookiecutter template:make templateCommit everything to git and send a pull requestChanging the Project's Python DependenciesTo change the production dependencies in thesetup.cfgfile:Change the dependencies in the.cookiecutter/includes/setuptools/install_requiresfile.
If this file doesn't exist yet create it and add some dependencies to it.
For example:pyramid
sqlalchemy
celeryRe-run the cookiecutter template:make templateCommit everything to git and send a pull requestTo change the project's formatting, linting and test dependencies:Change the dependencies in the.cookiecutter/includes/tox/depsfile.
If this file doesn't exist yet create it and add some dependencies to it.
Use tox'sfactor-conditional settingsto limit which environment(s) each dependency is used in.
For example:lint: flake8,
format: autopep8,
lint,tests: pytest-faker,Re-run the cookiecutter template:make templateCommit everything to git and send a pull request