Skip to content

feat: add backup level IAM policy controls#799

Merged
gcf-merge-on-green[bot] merged 11 commits intogoogleapis:masterfrom
AVaksman:backup_IAM_controls
Oct 26, 2020
Merged

feat: add backup level IAM policy controls#799
gcf-merge-on-green[bot] merged 11 commits intogoogleapis:masterfrom
AVaksman:backup_IAM_controls

Conversation

@AVaksman
Copy link
Contributor

The new features allow user to check and tune IAM policy for the backup level:

  • getIamPolicy - allows a user obtain the current resource IAM policy.

  • setIamPolicy - allows a user to set resource level IAM policy.

  • testIamPermissions - allows a user to pass a list of permissions and get back a sub-list of granted permissions.

  • Ensure the tests and linter pass

  • Code coverage does not decrease (if any source code was changed)

  • Appropriate docs were updated (if necessary)

@AVaksman AVaksman requested a review from a team as a code owner September 14, 2020 17:41
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 14, 2020
@codecov
Copy link

codecov bot commented Sep 14, 2020

Codecov Report

Merging #799 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #799      +/-   ##
==========================================
+ Coverage   99.21%   99.24%   +0.02%     
==========================================
  Files          18       18              
  Lines       17050    17169     +119     
  Branches     1047      958      -89     
==========================================
+ Hits        16917    17040     +123     
+ Misses        130      126       -4     
  Partials        3        3              
Impacted Files Coverage Δ
src/backup.ts 100.00% <100.00%> (ø)
src/table.ts 99.89% <100.00%> (ø)
src/v2/bigtable_table_admin_client.ts 98.98% <0.00%> (+0.02%) ⬆️
src/v2/bigtable_instance_admin_client.ts 98.81% <0.00%> (+0.03%) ⬆️
src/v2/bigtable_client.ts 96.62% <0.00%> (+0.12%) ⬆️
src/chunktransformer.ts 99.77% <0.00%> (+0.22%) ⬆️

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 a14ccba...7755db7. Read the comment docs.

@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/nodejs-bigtable API. label Sep 15, 2020
Copy link
Contributor

@kolea2 kolea2 left a comment

Choose a reason for hiding this comment

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

will follow up on this feature

@AVaksman AVaksman requested a review from a team September 21, 2020 16:33
test/backup.ts Outdated
});

it('should accept permissions as array', done => {
const permissions = ['bigtable.tables.get', 'bigtable.tables.list'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

(and elsewhere in these tests)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done
Thanks

sinon.restore();
});
const policy = {};
it('should correctly call Table#setIamPolicy()', done => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Backup#setIamPolicy()

Copy link
Contributor Author

@AVaksman AVaksman Oct 15, 2020

Choose a reason for hiding this comment

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

Backup IAM policy controls functions delegate to/reuse Table IAM policy controls functions.
Please refer below
setIamPolicy
getIamPolicy
testIamPermissions

The unit tests verify that corresponding Table functions are properly called.

Copy link
Contributor

@kolea2 kolea2 left a comment

Choose a reason for hiding this comment

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

lgtm, @crwilcox can you take another look?

@crwilcox crwilcox added the automerge Merge the pull request once unit tests and other checks pass. label Oct 26, 2020
@gcf-merge-on-green gcf-merge-on-green bot merged commit 0f3b8b3 into googleapis:master Oct 26, 2020
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants