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
feat: add backup level IAM policy controls #799
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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
test/backup.ts
Outdated
}); | ||
|
||
it('should accept permissions as array', done => { | ||
const permissions = ['bigtable.tables.get', 'bigtable.tables.list']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these should be similar to: https://github.com/googleapis/java-bigtable/pull/450/files#diff-84d1a07ba982b6e9cac6f4e6ae0bb75a4531804decf3de85ece5e475c7720801R356-R359
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backup#setIamPolicy()
There was a problem hiding this comment.
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.
There was a problem hiding this 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?
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 ofpermissions
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)