[PR #1258] [MERGED] Additional bucket response attributes #1333

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

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/1258
Author: @manuteleco
Created: 7/22/2023
Status: Merged
Merged: 7/30/2023
Merged by: @fsouza

Base: mainHead: additional_bucket_response_attributes


📝 Commits (3)

  • de0a037 Support bucket creation time in the FS backend
  • d1d1e94 Include the updated attribute in Bucket object responses
  • f368461 Include the storageClass attribute in Bucket object responses

📊 Changes

4 files changed (+19 additions, -1 deletions)

View changed files

📝 fakestorage/bucket_test.go (+6 -0)
📝 fakestorage/response.go (+4 -0)
📝 internal/backend/backend_test.go (+4 -0)
📝 internal/backend/fs.go (+5 -1)

📄 Description

Include additional attributes in Bucket responses, so that fake-gcs-server can be used with certain client libraries that rely on those attributes being there (like googleCloudStorageR).

With these changes we include three additional attributes: timeCreated (was already present when using the Memory backend), updated and storageClass.

So we go from:

curl -s 'http://localhost:8080/storage/v1/b/?project=my-dummy-project-id' | jq
{
  "kind": "storage#buckets",
  "items": [
    {
      "kind": "storage#bucket",
      "id": "my-bucket",
      "name": "my-bucket",
      "versioning": {},
      "location": "US-CENTRAL1"
    }
  ]
}

to:

curl -s 'http://localhost:8080/storage/v1/b/?project=my-dummy-project-id' | jq
{
  "kind": "storage#buckets",
  "items": [
    {
      "kind": "storage#bucket",
      "id": "my-bucket",
      "name": "my-bucket",
      "versioning": {},
      "timeCreated": "2023-07-22T09:01:26.287332+02:00",
      "updated": "2023-07-22T09:01:26.287332+02:00",
      "location": "US-CENTRAL1",
      "storageClass": "STANDARD"
    }
  ]
}

🔄 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/1258 **Author:** [@manuteleco](https://github.com/manuteleco) **Created:** 7/22/2023 **Status:** ✅ Merged **Merged:** 7/30/2023 **Merged by:** [@fsouza](https://github.com/fsouza) **Base:** `main` ← **Head:** `additional_bucket_response_attributes` --- ### 📝 Commits (3) - [`de0a037`](https://github.com/fsouza/fake-gcs-server/commit/de0a0372f2be5ee69600061d28f43d4a32853bfd) Support bucket creation time in the FS backend - [`d1d1e94`](https://github.com/fsouza/fake-gcs-server/commit/d1d1e946900e1fead2b165d92511c0bbdd107e11) Include the `updated` attribute in Bucket object responses - [`f368461`](https://github.com/fsouza/fake-gcs-server/commit/f3684614c23ed0cc0f3e389fe9d137b57346703d) Include the `storageClass` attribute in Bucket object responses ### 📊 Changes **4 files changed** (+19 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `fakestorage/bucket_test.go` (+6 -0) 📝 `fakestorage/response.go` (+4 -0) 📝 `internal/backend/backend_test.go` (+4 -0) 📝 `internal/backend/fs.go` (+5 -1) </details> ### 📄 Description Include additional attributes in Bucket responses, so that `fake-gcs-server` can be used with certain client libraries that rely on those attributes being there (like [googleCloudStorageR](https://cran.r-project.org/web/packages/googleCloudStorageR)). With these changes we include three additional attributes: `timeCreated` (was already present when using the Memory backend), `updated` and `storageClass`. So we go from: ```shell curl -s 'http://localhost:8080/storage/v1/b/?project=my-dummy-project-id' | jq { "kind": "storage#buckets", "items": [ { "kind": "storage#bucket", "id": "my-bucket", "name": "my-bucket", "versioning": {}, "location": "US-CENTRAL1" } ] } ``` to: ```shell curl -s 'http://localhost:8080/storage/v1/b/?project=my-dummy-project-id' | jq { "kind": "storage#buckets", "items": [ { "kind": "storage#bucket", "id": "my-bucket", "name": "my-bucket", "versioning": {}, "timeCreated": "2023-07-22T09:01:26.287332+02:00", "updated": "2023-07-22T09:01:26.287332+02:00", "location": "US-CENTRAL1", "storageClass": "STANDARD" } ] } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:34: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#1333
No description provided.