Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

feat: support for Table ACLs#653

Merged
stephaniewang526 merged 18 commits intogoogleapis:masterfrom
shollyman:fr-tableacls
Aug 25, 2020
Merged

feat: support for Table ACLs#653
stephaniewang526 merged 18 commits intogoogleapis:masterfrom
shollyman:fr-tableacls

Conversation

@shollyman
Copy link
Copy Markdown
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 This human has signed the Contributor License Agreement. label Aug 6, 2020
@codecov
Copy link
Copy Markdown

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 Issues related to the googleapis/java-bigquery API. label Aug 21, 2020
Copy link
Copy Markdown
Contributor

@pmakani pmakani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!, except clir and codecov.

@stephaniewang526 stephaniewang526 merged commit f0e67d8 into googleapis:master Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigquery Issues related to the googleapis/java-bigquery API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants