feat: add iam methods to templates by busunkim96 · Pull Request #545 · googleapis/gapic-generator-python · GitHub
Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

feat: add iam methods to templates#545

Merged
software-dov merged 10 commits into
masterfrom
add-iam-methods
Jul 22, 2020
Merged

feat: add iam methods to templates#545
software-dov merged 10 commits into
masterfrom
add-iam-methods

Conversation

@busunkim96

@busunkim96 busunkim96 commented Jul 22, 2020

Copy link
Copy Markdown
Contributor

Closes #536

This adds a new generator option add-iam-methods.

The option adds the three standard IAM methods get_iam_policy, set_iam_policy, and test_iam_permissions. This option is a replacement for reroute_to_grpc_interface in the monolith. reroute_to_grpc_interface is used by KMS and Pub/Sub to expose the IAM methods. Future clients are not expected to use this option.

This PR copy-pastes the IAM methods from the cloud functions client into the templates. The only edits are to the endpoint.

I tried get_iam_policy with KMS and I get the same result as the existing library.

The down-side of copy-pasting is that this code is prone to being missed in changes to the templated methods/tests. I tried adding the methods at the API schema level but was unsuccessful. I'm not very familiar with how the schema works, so if there's a good way to make the change at that level I'm happy to rework this PR.

Failing showcase tests should pass once proto-plus 1.3.2 makes it to PyPI.

@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Jul 22, 2020
@busunkim96 busunkim96 marked this pull request as ready for review July 22, 2020 04:56
@codecov

codecov Bot commented Jul 22, 2020

Copy link
Copy Markdown

@software-dov software-dov merged commit 3f42c3c into master Jul 22, 2020
@software-dov software-dov deleted the add-iam-methods branch July 22, 2020 17:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add alternative to reroute_to_grpc_interface

2 participants