[GH-ISSUE #1257] Iam policy on bucket - not working #179

Open
opened 2026-03-03 12:08:57 +03:00 by kerem · 2 comments
Owner

Originally created by @tomaszmacnar on GitHub (Jul 19, 2023).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1257

I use fake-gcs-server in my integration tests.
I create bucket and after it i try to get IAm policy on it. After call (java):

storage.getIamPolicy("XXX", Storage.BucketSourceOption.requestedPolicyVersion(GCP_POLICY_VERSION));

and http return:
GET http://localhost:4443/storage/v1/b/XXX/iam?optionsRequestedPolicyVersion=3
Not Found
When i get bucket info it return OK:
GET http://localhost:4443/storage/v1/b/XXX

Is this mock not support iam ?

Originally created by @tomaszmacnar on GitHub (Jul 19, 2023). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1257 I use fake-gcs-server in my integration tests. I create bucket and after it i try to get IAm policy on it. After call (java): > storage.getIamPolicy("XXX", Storage.BucketSourceOption.requestedPolicyVersion(GCP_POLICY_VERSION)); and http return: GET http://localhost:4443/storage/v1/b/XXX/iam?optionsRequestedPolicyVersion=3 Not Found When i get bucket info it return OK: GET http://localhost:4443/storage/v1/b/XXX Is this mock not support iam ?
Author
Owner

@fsouza commented on GitHub (Jul 29, 2023):

Correct, that's currently not supported. With bucket attributes (#1174), it should be possible though.

<!-- gh-comment-id:1656495246 --> @fsouza commented on GitHub (Jul 29, 2023): Correct, that's currently not supported. With bucket attributes (#1174), it should be possible though.
Author
Owner

@vitalii-buchyn-exa commented on GitHub (Jun 25, 2024):

Hello community,

Having a similar issue, trying IAM().Policy(ctx) on a fake bucket, but getting 404

Just wonder if there is any workaround, except creating my own httptest server?

Thank you in advance.

<!-- gh-comment-id:2188633930 --> @vitalii-buchyn-exa commented on GitHub (Jun 25, 2024): Hello community, Having a similar issue, trying `IAM().Policy(ctx)` on a fake bucket, but getting 404 Just wonder if there is any workaround, except creating my own httptest server? Thank you in advance.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#179
No description provided.