Bucket Settings

Three independent per-bucket settings, each a read/write pair. Together they back the Setting tab of a bucket's detail view.

ConcernReadWrite
Privacys3_getBucketPrivacys3_setBucketPrivacy
Policys3_getBucketPoliciess3_upsertBucketPolicyGrant
CORSs3_getBucketCorsConfigs3_configureBucketCors

All requests go to the Storage gateway and need the authentication headers.


Bucket Privacy

Get Bucket Privacy

Query · s3_getBucketPrivacy

Reads whether a bucket is private.

Arguments

NameTypeRequiredDescription
bucketIdStringYesBucket to read

Variables

{
  "bucketId": "68b571f65f34c302831d923f"
}

Request

query getBucketPrivacy($bucketId: String!) {
  s3_getBucketPrivacy(bucketId: $bucketId) {
    bucketId
    bucketName
    privacy
  }
}

Response

Returns s3_BucketPrivacyOverview, which is non-null.

FieldTypeDescription
bucketIdStringIdentifier of the bucket
bucketNameStringName of the bucket
privacyBooleanWhether the bucket is private
{
  "data": {
    "s3_getBucketPrivacy": {
      "bucketId": "68b571f65f34c302831d923f",
      "bucketName": "bucket03",
      "privacy": true
    }
  }
}

Set Bucket Privacy

Mutation · s3_setBucketPrivacy

Sets whether a bucket is private.

Arguments

NameTypeRequiredDescription
inputs3_SetBucketPrivacyInputYesPrivacy setting

input

FieldTypeRequiredDescription
bucketIdStringYesBucket to change
privacyBooleanYestrue makes the bucket private

Variables

{
  "input": {
    "bucketId": "68b571f65f34c302831d923f",
    "privacy": false
  }
}

Request

mutation setBucketPrivacy($input: s3_SetBucketPrivacyInput!) {
  s3_setBucketPrivacy(input: $input) {
    success
    message
  }
}

Response

FieldTypeDescription
successBooleanWhether it worked
messageStringResult message
{
  "data": {
    "s3_setBucketPrivacy": {
      "success": true,
      "message": "Bucket privacy updated successfully"
    }
  }
}

Bucket Policy

Get Bucket Policies

Query · s3_getBucketPolicies

Reads the bucket's policy document.

Arguments

NameTypeRequiredDescription
bucketIdStringYesBucket to read

Variables

{
  "bucketId": "68b571f65f34c302831d923f"
}

Request

query getBucketPolicies($bucketId: String!) {
  s3_getBucketPolicies(bucketId: $bucketId) {
    id
    bucketPolicy
    createdAt
    updatedAt
  }
}

Response

FieldTypeDescription
idIDPolicy record identifier
bucketPolicys3_JSONObjectThe policy document, always present
createdAtFloatCreation timestamp
updatedAtFloatLast update timestamp
{
  "data": {
    "s3_getBucketPolicies": {
      "id": "68b571f65f34c302831d9240",
      "bucketPolicy": {
        "Version": "2012-10-17",
        "Statement": []
      },
      "createdAt": 1725417988748,
      "updatedAt": 1725421468701
    }
  }
}

Upsert Bucket Policy Grant

Mutation · s3_upsertBucketPolicyGrant

Creates or replaces the bucket's policy document.

Arguments

NameTypeRequiredDescription
inputs3_UpsertBucketPolicyGrantInputYesPolicy to set

input

FieldTypeRequiredDescription
bucketIdStringYesBucket to change
bucketPolicys3_JSONObjectYesThe policy document

Variables

{
  "input": {
    "bucketId": "68b571f65f34c302831d923f",
    "bucketPolicy": {
      "Version": "2012-10-17",
      "Statement": []
    }
  }
}

Request

mutation upsertBucketPolicyGrant($input: s3_UpsertBucketPolicyGrantInput!) {
  s3_upsertBucketPolicyGrant(input: $input) {
    success
    message
  }
}

Response

FieldTypeDescription
successBooleanWhether it worked
messageStringResult message
{
  "data": {
    "s3_upsertBucketPolicyGrant": {
      "success": true,
      "message": "Bucket policy updated successfully"
    }
  }
}

Bucket CORS

Get Bucket CORS Config

Query · s3_getBucketCorsConfig

Reads the bucket's CORS rules.

Arguments

NameTypeRequiredDescription
bucketIdStringYesBucket to read

Variables

{
  "bucketId": "68b571f65f34c302831d923f"
}

Request

query getBucketCorsConfig($bucketId: String!) {
  s3_getBucketCorsConfig(bucketId: $bucketId) {
    id
    bucketId
    cors {
      origins
      allowedMethods
      allowedHeaders
      exposeHeaders
      maxAgeSeconds
    }
    createdAt
    updatedAt
  }
}

Response

FieldTypeDescription
idIDCORS record identifier
bucketIdIDIdentifier of the bucket
cors[s3_BucketCorsRule]The rules — nullable
createdAtFloatCreation timestamp
updatedAtFloatLast update timestamp

s3_BucketCorsRule

FieldTypeRequiredDescription
origins[String]YesAllowed origins
allowedMethods[String]YesAllowed HTTP methods
allowedHeaders[String]NoAllowed request headers
exposeHeaders[String]NoResponse headers exposed to the browser
maxAgeSecondsFloatNoPreflight cache lifetime
{
  "data": {
    "s3_getBucketCorsConfig": {
      "id": "68b571f65f34c302831d9241",
      "bucketId": "68b571f65f34c302831d923f",
      "cors": [
        {
          "origins": ["https://example.com"],
          "allowedMethods": ["GET", "PUT"],
          "allowedHeaders": ["*"],
          "exposeHeaders": ["ETag"],
          "maxAgeSeconds": 3600
        }
      ],
      "createdAt": 1725417988748,
      "updatedAt": 1725421468701
    }
  }
}

Configure Bucket CORS

Mutation · s3_configureBucketCors

Replaces the bucket's CORS rules.

Arguments

NameTypeRequiredDescription
inputs3_ConfigureBucketCorsInputYesCORS rules

input

FieldTypeRequiredDescription
bucketIdStringYesBucket to change
cors[s3_CorsRuleInput]NoThe rules to set

s3_CorsRuleInput

FieldTypeRequiredDescription
origins[String]YesAllowed origins
allowedMethods[String]YesAllowed HTTP methods
allowedHeaders[String]NoAllowed request headers
exposeHeaders[String]NoResponse headers exposed to the browser
maxAgeSecondsIntNoPreflight cache lifetime

Variables

{
  "input": {
    "bucketId": "68b571f65f34c302831d923f",
    "cors": [
      {
        "origins": ["https://example.com"],
        "allowedMethods": ["GET", "PUT"],
        "allowedHeaders": ["*"],
        "exposeHeaders": ["ETag"],
        "maxAgeSeconds": 3600
      }
    ]
  }
}

Request

mutation configureBucketCors($input: s3_ConfigureBucketCorsInput!) {
  s3_configureBucketCors(input: $input) {
    id
    bucketId
    cors {
      origins
      allowedMethods
      allowedHeaders
      exposeHeaders
      maxAgeSeconds
    }
    createdAt
    updatedAt
  }
}

Response

Returns s3_BucketCorsConfigResponse, the same shape as Get Bucket CORS Config, and is non-null here.

{
  "data": {
    "s3_configureBucketCors": {
      "id": "68b571f65f34c302831d9241",
      "bucketId": "68b571f65f34c302831d923f",
      "cors": [
        {
          "origins": ["https://example.com"],
          "allowedMethods": ["GET", "PUT"],
          "allowedHeaders": ["*"],
          "exposeHeaders": ["ETag"],
          "maxAgeSeconds": 3600
        }
      ],
      "createdAt": 1725417988748,
      "updatedAt": 1725421468701
    }
  }
}