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

Implement IAM API #1192

Closed
4 of 7 tasks
stephenplusplus opened this issue Mar 30, 2016 · 17 comments
Closed
4 of 7 tasks

Implement IAM API #1192

stephenplusplus opened this issue Mar 30, 2016 · 17 comments
Assignees
Labels
api: compute Issues related to the Compute Engine API. api: pubsub Issues related to the Pub/Sub API. api: storage Issues related to the Cloud Storage API.

Comments

@stephenplusplus
Copy link
Contributor

stephenplusplus commented Mar 30, 2016

IAM is currently buried inside of our Pub/Sub code, but should be abstracted to be used with any API that supports it:

@dhermes
Copy link
Contributor

dhermes commented Mar 30, 2016

/cc @tseaver

@stephenplusplus
Copy link
Contributor Author

I haven't been able to get through to IAM with gRPC: stephenplusplus/grpc-usage-question#1

// @jgeewax

@stephenplusplus stephenplusplus added the status: blocked Resolving the issue is dependent on other work. label Apr 14, 2016
@stephenplusplus
Copy link
Contributor Author

@jgeewax for the libraries that use gRPC, there are no IAM endpoints defined within each service's proto files. For an HTTP API like Compute, can you give me an example of a URL where you think I can find an IAM endpoint?

I've tried on an autoscaler to test, https://www.googleapis.com/compute/v1/projects/nth-circlet-705/zones/us-central1-a/autoscalers/gcloud-tests-autoscaler-1468433795482/getIamPolicy -- 404, but I'm not sure if that was a good guess for where I could find an IAM endpoint.

@jgeewax
Copy link
Contributor

jgeewax commented Jul 14, 2016 via email

@stephenplusplus
Copy link
Contributor Author

Pub/Sub is supported using IAM: https://github.com/GoogleCloudPlatform/gcloud-node/blob/master/lib/pubsub/iam.js. It's Logging that's been an issue.

Maybe you can take a look at the repo I put together to demonstrate the problem. If it's an easy solution, it should be easy to catch where I went wrong. https://github.com/stephenplusplus/grpc-usage-question -- you can replace the URL at line 19 to send the request to a different "base URL". In my experience, I either get a "Not Implemented" error when I send the request to a Logging URL, or an error like the ones I describe in the issue: stephenplusplus/grpc-usage-question#1

Just worth mentioning, all of the above only affects the gRPC APIs (Logging, PubSub) -- there is still Compute, Resource Manager, and Storage that I don't know how to make IAM requests for.

@jgeewax
Copy link
Contributor

jgeewax commented Jul 14, 2016 via email

@stephenplusplus
Copy link
Contributor Author

The demo looks like it's dealing with resource manager -- which you're
saying is giving you a cancelled error (in the issue), right?

Yeah, I just wanted to make the repo as easy as possible to reproduce, since everyone should have a "Project" resource (but maybe not a "Sink" or "Log", etc)

For Logging, I don't see any IAM support there -- what resource are you
trying to :getIamPolicy on ?

I don't see any IAM support either, which is what I'm saying... only Pub/Sub seems to have a way to use IAM.

@stephenplusplus
Copy link
Contributor Author

stephenplusplus commented Jul 14, 2016

I get a Not Implemented API error when I try to send this request to the Logging base URL:

var protoOpts = {
  service: 'IAMPolicy',
  method: 'getIamPolicy'
};

var reqOpts = {
  resource: 'a/log/resource'
};

@jgeewax
Copy link
Contributor

jgeewax commented Jul 14, 2016 via email

@jgeewax
Copy link
Contributor

jgeewax commented Jul 14, 2016 via email

@stephenplusplus
Copy link
Contributor Author

Cool, thanks for checking into this stuff!

@jgeewax
Copy link
Contributor

jgeewax commented Jul 14, 2016

OK -- Resource Manager's docs are lying : they don't support gRPC today. Carry on.

@stephenplusplus
Copy link
Contributor Author

stephenplusplus commented Jul 14, 2016

Trying to move on with accessing Compute IAM through the IAM gRPC API to get the policy of an Address resource. Let me know what these values should be:

Base URL for the IAM request: ?
What I tried: www.googleapis.com/compute/v1 and www.googleapis.com/compute

Resource ID: ?
What I tried: projects/nth-circlet-705/regions/us-central1/addresses/gcloud-tests-address-1468516804722

gRPC prints this error to the console:

E0714 13:20:16.169033000 123145338609664 resolve_address_posix.c:118] getaddrinfo: nodename nor servname provided, or not known

@stephenplusplus
Copy link
Contributor Author

Update!

I ran it with this base URL: compute.googleapis.com and received the same error that we did with Resource Manager:

{ code: 499,
  metadata: Metadata { _internal_repr: {} },
  message: 'Client Closed Request' } null

@stephenplusplus
Copy link
Contributor Author

Our support of IAM at this time seems to be complete, in regards to what IAM accessors are available at this point upstream. The issue can stay open for when IAM is opened up for the missing APIs.

@stephenplusplus stephenplusplus removed their assignment Sep 2, 2016
@jmuk jmuk added priority: p2 Moderately-important priority. Fix may not be included in next release. Status: Acknowledged and removed status: blocked Resolving the issue is dependent on other work. labels Mar 7, 2017
@jmuk
Copy link
Contributor

jmuk commented Mar 7, 2017

"status: blocked" is removed due to the current status -- pubsub is done, and storage is coming.

@stephenplusplus stephenplusplus added api: logging Issues related to the Cloud Logging API. api: pubsub Issues related to the Pub/Sub API. labels Oct 18, 2017
@stephenplusplus stephenplusplus added api: storage Issues related to the Cloud Storage API. api: compute Issues related to the Compute Engine API. resource manager and removed api: logging Issues related to the Cloud Logging API. resource manager labels Oct 18, 2017
@stephenplusplus
Copy link
Contributor Author

Only Compute remains. Issue opened: googleapis/nodejs-compute#28

@stephenplusplus stephenplusplus removed priority: p2 Moderately-important priority. Fix may not be included in next release. type: enhancement labels Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: compute Issues related to the Compute Engine API. api: pubsub Issues related to the Pub/Sub API. api: storage Issues related to the Cloud Storage API.
Projects
None yet
Development

No branches or pull requests

4 participants