While writing system tests for the requester_pays feature, I triggered the following:
Traceback (most recent call last):
File "/home/tseaver/projects/agendaless/Google/src/google-cloud-python/storage/tests/system.py", line 372, in test_blob_acl_iam_w_user_project
blob.set_iam_policy(policy)
File "/home/tseaver/projects/agendaless/Google/src/google-cloud-python/storage/google/cloud/storage/blob.py", line 1148, in set_iam_policy
_target_object=None)
File "/home/tseaver/projects/agendaless/Google/src/google-cloud-python/storage/.nox/sys-3-6/lib/python3.6/site-packages/google/cloud/_http.py", line 293, in api_request
raise exceptions.from_http_response(response)
google.api.core.exceptions.BadRequest: 400 PUT https://www.googleapis.com/storage/v1/b/new_1506705016579/o/SmallFile/iam?userProject=citric-celerity-697: roles/storage.objectViewer is not a valid role for projects/_/buckets/new_1506705016579/objects/SmallFile#0.
Note that the earlier call to Blob.get_iam_policy does succeed, returning:
(Pdb) pp policy.to_api_repr()
{'bindings': [{'members': ['projectEditor:some-project-742',
'projectOwner:some-project-742',
'serviceAccount:1065521786570-19reuv03qbdp37du41inh9gtd1s35g1j@developer.gserviceaccount.com'],
'role': 'roles/storage.legacyObjectOwner'},
{'members': ['projectViewer:some-project-742'],
'role': 'roles/storage.legacyObjectReader'},
{'members': ['allUsers'], 'role': 'roles/storage.objectViewer'}],
'etag': 'CAM='}
We don't have existing system tests for Blob.set_iam_policy, but the Storage IAM docs don't define any IAM operations for blobs, only for buckets and projects. Indeed, they say:
To learn about controlling access to individual objects in your buckets, see Access Control Lists.
The API documentation for Objects also doesn't (any longer?) show getIamPolicy, setIamPolicy, or testIamPermissions.
@lukesneeringer can you loop somebody in to clarify?
While writing system tests for the
requester_paysfeature, I triggered the following:Note that the earlier call to
Blob.get_iam_policydoes succeed, returning:We don't have existing system tests for
Blob.set_iam_policy, but the Storage IAM docs don't define any IAM operations for blobs, only for buckets and projects. Indeed, they say:The API documentation for Objects also doesn't (any longer?) show
getIamPolicy,setIamPolicy, ortestIamPermissions.@lukesneeringer can you loop somebody in to clarify?