Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: save empty IAM policy bindings#155

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
busunkim96 merged 2 commits intomasterfromfix-154
Mar 23, 2021
Merged

fix: save empty IAM policy bindings#155

busunkim96 merged 2 commits intomasterfromfix-154
Mar 23, 2021

Conversation

@busunkim96
Copy link
Contributor

@busunkim96busunkim96 commentedMar 22, 2021
edited
Loading

Fixes#154

__getitem__ currently returns an emptyset() for items not in the bindings. If someone adds to the set returned by__getitem__ the changes will not be reflected on the actual policy object.

@busunkim96busunkim96 requested a review froma team as acode ownerMarch 22, 2021 21:52
@google-clagoogle-clabot added the cla: yesThis human has signed the Contributor License Agreement. labelMar 22, 2021
Comment on lines +35 to +36
assertlen(policy)==0
assertdict(policy)== {}
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Accessingpolicy.owners,policy.editors results in__getitem__ being called, which adds empty entries to the dictionary. I moved these empty dict asserts up as a result.

An alternative is to keep them in their previous location and check that the three roles with empty bindings were added

@busunkim96busunkim96 merged commit536c2ca intomasterMar 23, 2021
@busunkim96busunkim96 deleted the fix-154 branchMarch 23, 2021 19:16
gcf-merge-on-greenbot pushed a commit that referenced this pull requestMar 25, 2021
Exclude empty policy bindings (bindings with no members) in`Policy.__iter__()` and `Policy.__len__()`Follow up to#155
This was referencedMay 30, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@partheapartheaparthea approved these changes

@frankynfrankynAwaiting requested review from frankyn

Assignees

No one assigned

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

google.api_core.iam.Policy.__getitem__ does not correctly save empty bindings

2 participants

@busunkim96@parthea

[8]ページ先頭

©2009-2025 Movatter.jp