-
Notifications
You must be signed in to change notification settings - Fork 374
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
Create breakdown for additional Storage examples. #2256
Comments
I copied the wrong region tags into the previous set of bugs. See googleapis#2256 for details.
I just submitted a PR to fix several region tags. I clicked their checkboxes already. |
I copied the wrong region tags into the previous set of bugs. See #2256 for details.
What should the region tags be for disabling or viewing the bucket website configuration? |
@remyabel I looked again, and there is not one defined. If we add such an example we can use /cc: @frankyn FYI in case you have an opinion. |
Thanks @remyabel! |
What would be the difference between StatusOr<gcs::BucketAccessControl> patched_acl =
client.PatchBucketAcl(bucket_name, entity,
gcs::BucketAccessControlPatchBuilder().set_role(
gcs::BucketAccessControl::ROLE_OWNER())); This does not: StatusOr<gcs::BucketAccessControl> patched_acl = client.PatchBucketAcl(
bucket_name, entity,
gcs::BucketAccessControlPatchBuilder().delete_role()); It errors with |
So turns out that error is from nlohmann json. This: StatusOr<gcs::BucketAccessControl> patched_acl = client.PatchBucketAcl(bucket_name, entity,
gcs::BucketAccessControlPatchBuilder().set_role(
gcs::BucketAccessControl::ROLE_OWNER()).delete_entity()); seems very close to the example from PatchBucketAclRequest request(
"my-bucket", "user-test-user",
BucketAccessControlPatchBuilder().set_role("READER").delete_entity());
nl::json expected = {{"role", "READER"}, {"entity", nullptr}}; Unless I'm missing something obvious. This compiles and the tests pass now, but it doesn't work in practice:
|
The second should probably remove a entity from the access control list that has
That documentation is less than ideal. To remove a field you set it to So what you want to do is get the bucket ACL, remove the entry you do not want, and patch the bucket with the new ACL. |
Thanks. One more question (sorry if this is annoying), |
Oh, now that you mention that, there is this: google-cloud-cpp/google/cloud/storage/client.h Line 1469 in 34da3bb
That seems like the right API to document here. There is an existing example, we may be able to just re-use that example for this. Yes, there are two ways to manipulate the ACLs in a bucket: the {Create,Delete,Get,List,Update,Patch}BucketAcl functions, through the metadata functions. Actually it is three, you can do IAM policies too. I think we should use |
If we just use bucket.Acl = bucket.Acl.Where((acl) =>
!(acl.Entity == $"user-{userEmail}" && acl.Role == "OWNER")
).ToList(); My similar attempt: std::vector<gcs::BucketAccessControl> original_acl =
original_metadata->acl();
auto it = std::find_if(original_acl.begin(), original_acl.end(),
[entity](const gcs::BucketAccessControl& entry) {
return entry.entity() == entity &&
entry.role() ==
gcs::BucketAccessControl::ROLE_OWNER();
}); The problem is |
Did you use
The default (i.e. if we do not send a projection to the server) is equivalent to
Fair enough. |
I believe these already have implementations:
google-cloud-cpp/google/cloud/storage/examples/storage_default_object_acl_samples.cc Line 73 in 88ad9ea
|
I think this can be closed now. All samples should either be implemented or have open issues. |
Agree, thanks! |
For each region tag (and description) below we need to either:
We can close this bug once all the child bugs are created.
The text was updated successfully, but these errors were encountered: