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

feat: support for Table ACLs #653

Merged
merged 18 commits into from Aug 25, 2020
Merged

Conversation

shollyman
Copy link
Contributor

@shollyman shollyman commented Aug 6, 2020

This PR adds support for table-level permissions to BigQuery, which is implemented via the IAM meta API.
There's three mechanisms exposed: getIamPolicy, setIamPolicy, and testIamPermissions.

The service exposes a service-centric version of the responses, so we include a policy converter to map to/from the more general cloud IAM messages.

Differences from the other veneer (java-storage):

  • changed the response format of TestIamPermissions. The general pattern is to pass in a resource (table) and a list of permissions to check, and it returns the subset of that permission list which the caller actually holds on the resource. The storage veneer chose to implement this as a list of bools instead, which is nonstandard.

  • Policy conversion is much more forgiving. In java-storage, it's only top-level resources which return policies, so there's an expectation that all responses have actual bindings. Tables in BQ are nested within other elements that also convey permissions, so it's far more common and likely to have empty bindings on policies.

@google-cla google-cla bot added the cla: yes label Aug 6, 2020
@codecov
Copy link

@codecov codecov bot commented Aug 12, 2020

Codecov Report

Merging #653 into master will decrease coverage by 0.42%.
The diff coverage is 57.27%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #653      +/-   ##
============================================
- Coverage     81.49%   81.07%   -0.43%     
- Complexity     1226     1236      +10     
============================================
  Files            77       78       +1     
  Lines          6220     6329     +109     
  Branches        691      702      +11     
============================================
+ Hits           5069     5131      +62     
- Misses          792      833      +41     
- Partials        359      365       +6     
Impacted Files Coverage Δ Complexity Δ
...y/src/main/java/com/google/cloud/bigquery/Acl.java 71.42% <ø> (ø) 13.00 <0.00> (ø)
.../main/java/com/google/cloud/bigquery/BigQuery.java 76.23% <0.00%> (-1.15%) 0.00 <0.00> (ø)
...ava/com/google/cloud/bigquery/BigQueryOptions.java 88.88% <ø> (ø) 11.00 <0.00> (ø)
.../google/cloud/bigquery/spi/v2/HttpBigQueryRpc.java 4.94% <0.00%> (-0.26%) 2.00 <0.00> (ø)
...n/java/com/google/cloud/bigquery/PolicyHelper.java 65.00% <65.00%> (ø) 6.00 <6.00> (?)
...n/java/com/google/cloud/bigquery/BigQueryImpl.java 82.84% <73.33%> (-0.75%) 77.00 <3.00> (+3.00) ⬇️
...c/main/java/com/google/cloud/bigquery/TableId.java 85.18% <100.00%> (+1.18%) 15.00 <1.00> (+1.00)
.../com/google/cloud/bigquery/spi/v2/BigQueryRpc.java 82.60% <100.00%> (+0.79%) 0.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f08becc...293f81e. Read the comment docs.

@product-auto-label product-auto-label bot added the api: bigquery label Aug 21, 2020
@shollyman shollyman requested a review from stephaniewang526 Aug 21, 2020
@stephaniewang526 stephaniewang526 requested a review from pmakani Aug 21, 2020
Copy link
Contributor

@pmakani pmakani left a comment

LGTM!, except clir and codecov.

@stephaniewang526 stephaniewang526 merged commit f0e67d8 into googleapis:master Aug 25, 2020
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants