fsouza/fake-gcs-server

Unable to list bucket with alpakka client lib due to missing field(s)

Opened this issue · 0 comments

I've uploaded some objects into a test bucket with the latest release version v1.50.2 and try to list the test bucket contents via alpakka client lib (https://doc.akka.io/libraries/alpakka/current/google-cloud-storage.html#list-bucket-contents). The lib assumes the following structure for the "acl" field:

  private final case class ObjectAccessControls(kind: String,
                                                id: String,
                                                selfLink: String,
                                                bucket: String,
                                                `object`: String,
                                                generation: String,
                                                entity: String,
                                                role: String,
                                                email: String,
                                                entityId: String,
                                                domain: String,
                                                projectTeam: ProjectTeam,
                                                etag: String)

but its missing some of these fields like "id" for example in the response and therefore throws an exception. Do I miss something? The official gcs documentation for this object type is here: https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls#resource-representations

Response from the fake-gcs-server:

{
  "items" : [ {
    "acl" : [ {
      "bucket" : "test_bucket",
      "entity" : "projectOwner-test-project",
      "etag" : "RVRhZw==",
      "kind" : "storage#objectAccessControl",
      "object" : "abwicklungsmengen/DataForAggregationTesting_2022-01-03-00-00-00.txt",
      "projectTeam" : { },
      "role" : "OWNER"
    } ],
    "bucket" : "test_bucket",
    "contentType" : "application/octet-stream",
    "crc32c" : "4rJcjA==",
    "etag" : "CS14W2cpr698UlqnbhH0hQ==",
    "generation" : "1734441772622141",
    "id" : "test_bucket/abwicklungsmengen/DataForAggregationTesting_2022-01-03-00-00-00.txt",
    "kind" : "storage#object",
    "md5Hash" : "CS14W2cpr698UlqnbhH0hQ==",
    "mediaLink" : "http://0.0.0.0:4443/download/storage/v1/b/test_bucket/o/abwicklungsmengen%2FDataForAggregationTesting_2022-01-03-00-00-00.txt?alt=media",
    "metageneration" : "1",
    "name" : "abwicklungsmengen/DataForAggregationTesting_2022-01-03-00-00-00.txt",
    "selfLink" : "http://0.0.0.0:4443/storage/v1/b/test_bucket/o/abwicklungsmengen%2FDataForAggregationTesting_2022-01-03-00-00-00.txt",
    "size" : "138",
    "storageClass" : "STANDARD",
    "timeCreated" : "2024-12-17T13:22:52.622135Z",
    "timeStorageClassUpdated" : "2024-12-17T13:22:52.62214Z",
    "updated" : "2024-12-17T13:22:52.62214Z"
  }, {
    "acl" : [ {
      "bucket" : "test_bucket",
      "entity" : "projectOwner-test-project",
      "etag" : "RVRhZw==",
      "kind" : "storage#objectAccessControl",
      "object" : "abwicklungsmengen/DataForAggregationTesting_2022-01-04-00-00-00.txt",
      "projectTeam" : { },
      "role" : "OWNER"
    } ],
    "bucket" : "test_bucket",
    "contentType" : "application/octet-stream",
    "crc32c" : "q/rcDw==",
    "etag" : "3iYL8URA0SdAj/hX7JYTIw==",
    "generation" : "1734441772635009",
    "id" : "test_bucket/abwicklungsmengen/DataForAggregationTesting_2022-01-04-00-00-00.txt",
    "kind" : "storage#object",
    "md5Hash" : "3iYL8URA0SdAj/hX7JYTIw==",
    "mediaLink" : "http://0.0.0.0:4443/download/storage/v1/b/test_bucket/o/abwicklungsmengen%2FDataForAggregationTesting_2022-01-04-00-00-00.txt?alt=media",
    "metageneration" : "1",
    "name" : "abwicklungsmengen/DataForAggregationTesting_2022-01-04-00-00-00.txt",
    "selfLink" : "http://0.0.0.0:4443/storage/v1/b/test_bucket/o/abwicklungsmengen%2FDataForAggregationTesting_2022-01-04-00-00-00.txt",
    "size" : "137",
    "storageClass" : "STANDARD",
    "timeCreated" : "2024-12-17T13:22:52.635004Z",
    "timeStorageClassUpdated" : "2024-12-17T13:22:52.635008Z",
    "updated" : "2024-12-17T13:22:52.635008Z"
  }, {
    "acl" : [ {
      "bucket" : "test_bucket",
      "entity" : "projectOwner-test-project",
      "etag" : "RVRhZw==",
      "kind" : "storage#objectAccessControl",
      "object" : "abwicklungsmengen/LMA_AWM_Export_2022-11-05-00-00-00.txt",
      "projectTeam" : { },
      "role" : "OWNER"
    } ],
    "bucket" : "test_bucket",
    "contentType" : "application/octet-stream",
    "crc32c" : "JilXew==",
    "etag" : "Dye/u06a+x/r3G6L7gvw6g==",
    "generation" : "1734441772597178",
    "id" : "test_bucket/abwicklungsmengen/LMA_AWM_Export_2022-11-05-00-00-00.txt",
    "kind" : "storage#object",
    "md5Hash" : "Dye/u06a+x/r3G6L7gvw6g==",
    "mediaLink" : "http://0.0.0.0:4443/download/storage/v1/b/test_bucket/o/abwicklungsmengen%2FLMA_AWM_Export_2022-11-05-00-00-00.txt?alt=media",
    "metageneration" : "1",
    "name" : "abwicklungsmengen/LMA_AWM_Export_2022-11-05-00-00-00.txt",
    "selfLink" : "http://0.0.0.0:4443/storage/v1/b/test_bucket/o/abwicklungsmengen%2FLMA_AWM_Export_2022-11-05-00-00-00.txt",
    "size" : "144",
    "storageClass" : "STANDARD",
    "timeCreated" : "2024-12-17T13:22:52.597174Z",
    "timeStorageClassUpdated" : "2024-12-17T13:22:52.597178Z",
    "updated" : "2024-12-17T13:22:52.597178Z"
  } ],
  "kind" : "storage#objects"
}