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: add backup level IAM policy controls #799

Merged
merged 11 commits into from Oct 26, 2020

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.

system-test/bigtable.ts Outdated Show resolved Hide resolved
system-test/bigtable.ts Outdated Show resolved Hide resolved
system-test/bigtable.ts Outdated Show resolved Hide resolved
test/backup.ts Outdated Show resolved Hide resolved
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/nodejs-bigtable API. label Sep 15, 2020
test/backup.ts Outdated Show resolved Hide resolved
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 as a code owner September 21, 2020 16:33
src/backup.ts Show resolved Hide resolved
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.

None yet

4 participants