-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(api_core): support version 3 policy bindings #9869
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
Conversation
74a32cc to
583ca42
Compare
583ca42 to
6c9556d
Compare
api_core/google/api_core/iam.py
Outdated
|
|
||
| @property | ||
| def bindings(self): | ||
| """:obj:`list` of :obj:`dict`: The policy's bindings 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.
Not sure how we'd document dict keys, I couldn't find any examples in the Google style guides.
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.
Mypy uses the form Dict[key_type, value_type]. Not sure if this is an official guideline, but at least in BigQuery we follow this format (at least in the docstrings that follow the Google-style format). I also found quite a few occurrences of the same in firestore.
Hope this helps!
api_core/google/api_core/iam.py
Outdated
| members (:obj:`set` of str): Specifies the identities associated to this binding. | ||
| condition (dict of str:str): Specifies a condition under which this binding will apply. | ||
| :obj:`dict` Condition: |
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.
should this be nested under binding?
|
This PR broke Looking at the source, the error is raised if Question: What significance does |
This
proposalchange uses a list of (binding) dicts as the underlying data structure, while providing backwards compatibility for v1 Policy.The
Policyclass is still inheriting fromMutableMapping, but throws an exception if policy's version is3and the user try to access it as if it were a dict (via accessors, setter, iterator etc).