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

Enable auth via oauth2client: 3LO, Implicit from Environ, p12 and JSON service account #335

Closed
5 of 6 tasks
silvolu opened this issue Nov 4, 2014 · 20 comments
Closed
5 of 6 tasks
Assignees
Labels
auth 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@silvolu
Copy link
Contributor

silvolu commented Nov 4, 2014

Please leave this on hold until we move the credential dance into oauth2client and update apitools, I will update this issue tomorrow.

Things to be done (added by @dhermes):

@silvolu silvolu added this to the M1: core, datastore & storage milestone Nov 4, 2014
@silvolu
Copy link
Contributor Author

silvolu commented Nov 4, 2014

I've been talking with @craigcitro this morning about moving parts of the credentials dance implemented in apitools into the oauth2client, I'll work on that this afternoon.

@dhermes
Copy link
Contributor

dhermes commented Nov 4, 2014

w00t

I'm happy to help do this, I have done a fair amount of work in oauth2client.

@silvolu
Copy link
Contributor Author

silvolu commented Nov 4, 2014

If you want to do it, it's all yours :)

@craigcitro
Copy link
Contributor

+1, happy to accept pull requests -- as a heads-up, i'm about to do a giant merge over in oauth2client.

@dhermes
Copy link
Contributor

dhermes commented Nov 4, 2014

@craigcitro

  1. Can you ping this issue when the giant merge occurs?
  2. I'd need a better understanding of what is happening in apitools before tackling, so as not to reinvent the wheel.
  3. I am time-constrained so would need to prioritize. However in my experience auth takes a disproportionate amount of time for devs and we should work very hard to minimize it.

@silvolu
Copy link
Contributor Author

silvolu commented Nov 4, 2014

@dhermes for 2) we can VC if you want, I'm busy now but I'll be free in the afternoon.
For 3), I'm happy to do it if you don't have time for it, just let me know!

@craigcitro
Copy link
Contributor

giant merge is done, oauth2client now supports python3 at HEAD. (w00t!)

@dhermes
Copy link
Contributor

dhermes commented Nov 4, 2014

@craigcitro is googleapis/google-api-python-client@0bf61f2 the relevant commit? I assume the October 15 date is because that's when you committed it locally?

@craigcitro
Copy link
Contributor

nope, googleapis/oauth2client@0dacff1 -- oauth2client is in its own repo now.

@dhermes
Copy link
Contributor

dhermes commented Nov 4, 2014

DERP. My bad.

@silvolu silvolu changed the title Use apitools credentials_lib for auth Use oauth2client for auth Nov 6, 2014
@dhermes dhermes self-assigned this Dec 4, 2014
@dhermes
Copy link
Contributor

dhermes commented Dec 4, 2014

@silvolu just had a chat with @craigcitro and hope to tackle this soon.

Luckily most is handled by GoogleCredentials.get_application_default() but there are some rough edges to work around.

@dhermes dhermes changed the title Use oauth2client for auth Enable auth via oauth2client: 3LO, Implicit from Environ, p12 and JSON service account Dec 30, 2014
@dhermes
Copy link
Contributor

dhermes commented Jan 12, 2015

I'll try to tackle 3LO with a user-flow this week.

dhermes added a commit to dhermes/google-cloud-python that referenced this issue Jan 13, 2015
dhermes added a commit to dhermes/google-cloud-python that referenced this issue Jan 13, 2015
@dhermes
Copy link
Contributor

dhermes commented Jan 15, 2015

@silvolu Adding 3LO is as simple as documenting

gcloud auth login

and then telling them to call

from gcloud import credentials
creds = credentials.get_credentials()

If using just Datastore it's even more "just works":

from gcloud import datastore
datastore.set_defaults()

Where do you think this should go?

@silvolu
Copy link
Contributor Author

silvolu commented Jan 15, 2015

In the gcloud-node docs the auth bits are in the snippets contained in the 'getting started with gcloud' section, but I think this is more relevant to using the demos we provide with gcloud-python, so it should probably go in the 'API x in 10 seconds' sections. @jgeewax ?

@jgeewax
Copy link
Contributor

jgeewax commented Jan 15, 2015

Would it make sense to have an "Authentication" section at the same hierarchy level as each of the services ?

If I'm a developer and I'm trying to get set up, the "... in 10 seconds" pages are great, but I might want more detail about stuff. 3LO is a "more detail" thing. "... in 10 seconds" would be how the typical person does this (and typically, I'd use a service account with 2LO).

Thoughts?

@silvolu
Copy link
Contributor Author

silvolu commented Jan 15, 2015

"... in 10 seconds" would be how the typical person does this (and typically, I'd use a service account with 2LO).

It's currently showing how to use the demo, which is why it's where it makes sense to use 3LO (authorized with gcloud cli and reuse credentials vs create project, download key etc)

@jgeewax
Copy link
Contributor

jgeewax commented Jan 15, 2015

Might be worthwhile to toss in:

If I already have the Cloud SDK and the goal is "quickest way to get code actually working", then the gcloud auth login + datastore.set_defaults() is the fastest option. If they don't already have the SDK (which a lot of people don't -- nor do they want it...) then this is not the fastest way to get this moving.

Further, if we're measuring time from pip install to "running code on a server somewhere", then they'll have to use 2LO anyway, so they'll have to create a service account, pull down the key, and write code that uses that key (assuming they are not on GAE or GCE).

I'm in the group where I expect that talking to some outside service needs a "config.py" file of some sort (ie Django with settings.py) -- and I want to get that done right away. If there's magical "oh don't worry we hooked all the stuff together" then come deployment time I'm not the happiest camper because learning time is supposed to be coming to an end (maybe I'm the exception here). There's the edge case of "if I'm running in GCE", but unfortunately it is absurdly easy to screw this up (you have to click Advanced on your image at creation time and make sure that Datastore and whatever else is enabled -- otherwise you have to start over...)

Because of that, I'd want to highlight 2LO as "the way" to do this (including the "get a service account, pull down a JSON file, etc), and document 3LO as well, but not right in your face in the "... in 10 seconds" route.

Tell me if I'm totally crazy on this.

atulep pushed a commit that referenced this issue Apr 6, 2023
Source-Link: googleapis/synthtool@82f5cb2
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:5d8da01438ece4021d135433f2cf3227aa39ef0eaccc941d62aa35e6902832ae

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
atulep pushed a commit that referenced this issue Apr 6, 2023
Source-Link: googleapis/synthtool@82f5cb2
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:5d8da01438ece4021d135433f2cf3227aa39ef0eaccc941d62aa35e6902832ae

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
atulep pushed a commit that referenced this issue Apr 18, 2023
Source-Link: googleapis/synthtool@82f5cb2
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:5d8da01438ece4021d135433f2cf3227aa39ef0eaccc941d62aa35e6902832ae

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea added a commit that referenced this issue Jun 4, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/26c7505b2f76981ec1707b851e1595c8c06e90fc
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f946c75373c2b0040e8e318c5e85d0cf46bc6e61d0a01f3ef94d8de974ac6790
parthea pushed a commit that referenced this issue Jun 4, 2023
* fix: change timeout settings for SearchJobsForAlert

PiperOrigin-RevId: 528815611

Source-Link: googleapis/googleapis@b473ccc

Source-Link: googleapis/googleapis-gen@4efc7a2
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGVmYzdhMjIyMDhkNzVkMDYzNGNiMDQ2MTQ5MDk1NGRkNjlmYzZkZiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 451250442

Source-Link: googleapis/googleapis@cca5e81

Source-Link: googleapis/googleapis-gen@0b219da
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGIyMTlkYTE2MWE4YmRjYzNjNmY3YjJlZmNkODIxMDUxODJhMzBjYSJ9
parthea added a commit that referenced this issue Jun 4, 2023
fix(deps): require proto-plus >= 1.22.0
parthea added a commit that referenced this issue Sep 20, 2023
* fix: remove delays from LRO operations samples.

* fix linters.

* fix logic.

* fix linters.

Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Sep 22, 2023
…335)

Source-Link: https://togithub.com/googleapis/synthtool/commit/395d53adeeacfca00b73abf197f65f3c17c8f1e9
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:6c1cbc75c74b8bdd71dada2fa1677e9d6d78a889e9a70ee75b93d1d0543f96e1
parthea pushed a commit that referenced this issue Sep 22, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/26c7505b2f76981ec1707b851e1595c8c06e90fc
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f946c75373c2b0040e8e318c5e85d0cf46bc6e61d0a01f3ef94d8de974ac6790
parthea added a commit that referenced this issue Sep 22, 2023
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Sep 22, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/30bd01b4ab78bf1b2a425816e15b3e7e090993dd
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:9bc5fa3b62b091f60614c08a7fb4fd1d3e1678e326f34dd66ce1eefb5dc3267b
parthea pushed a commit that referenced this issue Sep 22, 2023
…p/templates/python_library/.kokoro (#335)

Source-Link: https://togithub.com/googleapis/synthtool/commit/bb171351c3946d3c3c32e60f5f18cee8c464ec51
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f62c53736eccb0c4934a3ea9316e0d57696bb49c1a7c86c726e9bb8a2f87dadf
parthea added a commit that referenced this issue Sep 22, 2023
* chore: exclude requirements.txt file from renovate-bot

Source-Link: googleapis/synthtool@f58d313
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7a40313731a7cb1454eef6b33d3446ebb121836738dc3ab3d2d3ded5268c35b6

* update constraints files

* fix(deps): require protobuf 3.20.2

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Sep 22, 2023
Source-Link: googleapis/synthtool@050953d
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:65e656411895bff71cffcae97246966460160028f253c2e45b7a25d805a5b142

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
* chore: update Java and Python dependencies

PiperOrigin-RevId: 408420890

Source-Link: googleapis/googleapis@2921f9f

Source-Link: googleapis/googleapis-gen@6598ca8
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjU5OGNhOGNiYmY1MjI2NzMzYTA5OWM0NTA2NTE4YTVhZjZmZjc0YyJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
Source-Link: googleapis/synthtool@56da63e
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:993a058718e84a82fda04c3177e58f0a43281a996c7c395e0a56ccc4d6d210d7
parthea pushed a commit that referenced this issue Oct 21, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this issue Oct 21, 2023
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
)

Source-Link: googleapis/synthtool@7804ade
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
* docs: Fix formatting of request arg in docstring

chore: Update gapic-generator-python to v1.9.1
PiperOrigin-RevId: 518604533

Source-Link: googleapis/googleapis@8a085ae

Source-Link: googleapis/googleapis-gen@b2ab4b0
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjJhYjRiMGEwYWUyOTA3ZTgxMmMyMDkxOThhNzRlMDg5OGFmY2IwNCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/26c7505b2f76981ec1707b851e1595c8c06e90fc
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f946c75373c2b0040e8e318c5e85d0cf46bc6e61d0a01f3ef94d8de974ac6790
parthea added a commit that referenced this issue Oct 22, 2023
Source-Link: googleapis/synthtool@82f5cb2
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:5d8da01438ece4021d135433f2cf3227aa39ef0eaccc941d62aa35e6902832ae

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Oct 22, 2023
Source-Link: https://togithub.com/googleapis/synthtool/commit/dede53ff326079b457cfb1aae5bbdc82cbb51dc3
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:fac304457974bb530cc5396abd4ab25d26a469cd3bc97cbfb18c8d4324c584eb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

5 participants