[PR #1013] [CLOSED] Add default ACL for predefined blobs #1117

Closed
opened 2026-03-03 12:33:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/1013
Author: @RachitSharma2001
Created: 12/15/2022
Status: Closed

Base: mainHead: fix_bug_945


📝 Commits (1)

  • 11ebc7b Add default ACL for predefined blobs

📊 Changes

1 file changed (+8 additions, -0 deletions)

View changed files

📝 main.go (+8 -0)

📄 Description

This fixes #944

I assumed that for any blob that is preloaded into a bucket, the ACL for each of them would just be [{'entity': 'projectOwner-test-project', 'role': 'OWNER'}]

The following python snippet now no longer crashes (although the issue #945 still remains unresolved, I am looking into this bug and hope to make a fix in the near future):

os.environ["STORAGE_EMULATOR_HOST"] = "http://0.0.0.0:4443"

client = storage.Client(
    credentials=AnonymousCredentials(),
    project="test-project",
)

# initial bucket/file for docker image
bucket_name = "sample-bucket"
blob_name = "some_file.txt"

# test
bucket = client.get_bucket(bucket_name)
blob = bucket.blob(blob_name)
print(list(blob.acl))
blob.make_public() 
blob.make_private()

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fsouza/fake-gcs-server/pull/1013 **Author:** [@RachitSharma2001](https://github.com/RachitSharma2001) **Created:** 12/15/2022 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix_bug_945` --- ### 📝 Commits (1) - [`11ebc7b`](https://github.com/fsouza/fake-gcs-server/commit/11ebc7b53ba21505c3f889bab3dd99ab137ce31f) Add default ACL for predefined blobs ### 📊 Changes **1 file changed** (+8 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `main.go` (+8 -0) </details> ### 📄 Description This fixes #944 I assumed that for any blob that is preloaded into a bucket, the ACL for each of them would just be `[{'entity': 'projectOwner-test-project', 'role': 'OWNER'}]` The following python snippet now no longer crashes (although the issue #945 still remains unresolved, I am looking into this bug and hope to make a fix in the near future): ``` os.environ["STORAGE_EMULATOR_HOST"] = "http://0.0.0.0:4443" client = storage.Client( credentials=AnonymousCredentials(), project="test-project", ) # initial bucket/file for docker image bucket_name = "sample-bucket" blob_name = "some_file.txt" # test bucket = client.get_bucket(bucket_name) blob = bucket.blob(blob_name) print(list(blob.acl)) blob.make_public() blob.make_private() ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:33:08 +03:00
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#1117
No description provided.