Skip to content

Commit 4a089a7

Browse files
authored
Update partner API schema with org quota and bucket regions details (#310)
* Update partner API schema with org quota and bucket regions details * prettier
1 parent 0a229cd commit 4a089a7

File tree

1 file changed

+66
-38
lines changed

1 file changed

+66
-38
lines changed

static/api/extensions/v1/api.yaml

Lines changed: 66 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ info:
99
1010
## Authentication
1111
12-
To authenticate with Tigris Object Store, you need to sign your requests with the signing key following simple steps:
12+
To authenticate with Tigris Object Store, you need to sign your requests with the signing key by following these steps:
1313
1414
:::note
1515
Reach out to [[email protected]](mailto:[email protected]) to request a:
@@ -18,13 +18,13 @@ info:
1818
:::
1919
2020
### 1. Generate current timestamp
21-
Set the `X-Tigris-Time` header to the current timestamp in milliseconds since epoch. Ex - `1731703213870`
21+
Set the `X-Tigris-Time` header to the current timestamp in milliseconds since epoch. Example: `1731703213870`
2222
```
2323
X-Tigris-Time: 1731703213870
2424
```
2525
2626
### 2. Generate a unique nonce
27-
Set the `X-Tigris-Nonce` header to a unique random string to identify the request and prevent replay attacks. Ex - `f8d133cb-5a42-47b1-9ef2-874bb55bab72`
27+
Set the `X-Tigris-Nonce` header to a unique random string to identify the request and prevent replay attacks. Example: `f8d133cb-5a42-47b1-9ef2-874bb55bab72`
2828
```
2929
X-Tigris-Nonce: f8d133cb-5a42-47b1-9ef2-874bb55bab72
3030
```
@@ -39,7 +39,7 @@ info:
3939
```
4040
4141
:::tip
42-
The `CanonicalURI` is the path of the request URL including the host and query parameters.
42+
The `CanonicalURI` is the full request URL including the scheme, host, path, and query parameters.
4343
4444
For example, for a `POST` request to `/provider/laravel/orgs/my-org/provision`, the `CanonicalURI` would be:
4545
```
@@ -54,7 +54,7 @@ info:
5454
5555
5656
### 4. Generate request signature
57-
Calculate the HMAC-SHA256 of the canonical request using the shared secret as the signing key. Ex -
57+
Calculate the HMAC-SHA256 of the canonical request using the shared secret as the signing key. Example:
5858
```
5959
Signature = hex(sha256sign(canonical_request, "signing_key"))
6060
```
@@ -88,7 +88,7 @@ paths:
8888
- buckets
8989
summary: Provision a new bucket
9090
description: |
91-
Provision a new bucket in the organization account, also creates the organization account if it doesn't exist. This is an
91+
Provisions a new bucket in the organization account and also creates the organization account if it doesn't exist. This is an
9292
idempotent operation, and calling it multiple times with the same parameters will not create duplicate buckets.
9393
9494
Provisioning API responds with an access key and secret to access the newly provisioned bucket.
@@ -229,7 +229,7 @@ paths:
229229
post:
230230
tags:
231231
- buckets
232-
summary: Attach a custom domain to bucket
232+
summary: Attach a custom domain to a bucket
233233
description: |
234234
Sets a custom domain for a bucket. If the domain is already set, it will be replaced.
235235
@@ -274,7 +274,7 @@ paths:
274274
- buckets
275275
summary: Remove custom domain from bucket
276276
description: |
277-
Removes the custom domain from a bucket. After removal, the bucket will only be accessible via its default Tigris URL.
277+
Removes the custom domain from a bucket. After removal, the bucket will only be accessible via its default Tigris URL.
278278
The CNAME DNS record can be safely deleted after the custom domain is removed.
279279
operationId: Tigris_DeleteCustomDomain
280280
parameters:
@@ -324,7 +324,7 @@ paths:
324324
post:
325325
tags:
326326
- iam
327-
summary: Rotates Access Key secret
327+
summary: Rotate Access Key secret
328328
description: |
329329
Rotates the access key secret for a user. The old secret will be invalidated, and the new secret will be returned in the response.
330330
operationId: Tigris_RotateAccessKey
@@ -616,6 +616,8 @@ components:
616616
type: string
617617
description:
618618
Name of the organization where the bucket should be provisioned
619+
org_quota:
620+
$ref: "#/components/schemas/OrgQuota"
619621
user_id:
620622
type: string
621623
description: ID of the user who is requesting the bucket
@@ -627,6 +629,17 @@ components:
627629
type: string
628630
description: Role assigned to the user in the organization
629631
enum: [Admin, Member]
632+
OrgQuota:
633+
type: object
634+
required:
635+
- limit_bytes
636+
properties:
637+
limit_bytes:
638+
type: integer
639+
format: int64
640+
description:
641+
The number of bytes that the organization is allowed to store across
642+
all of its buckets. Zero means no limit.
630643
BucketOptions:
631644
type: object
632645
properties:
@@ -637,6 +650,8 @@ components:
637650
false.
638651
storage_class:
639652
$ref: "#/components/schemas/StorageClass"
653+
regions:
654+
$ref: "#/components/schemas/Regions"
640655
enable_object_acl:
641656
type: boolean
642657
description:
@@ -648,25 +663,25 @@ components:
648663
description: |
649664
Configuration for object event notifications via webhook. Receive HTTP callbacks when objects are created, updated, or deleted in your bucket.
650665
651-
**Update behavior:**
652-
- `enabled` is required in all requests
653-
- Other fields (webhook, filter, region, auth) are optional and only update when included
654-
- Omitted optional fields preserve their existing values
655-
- Auth credentials are masked in responses and don't need to be re-sent
666+
**Update behavior (partial updates supported):**
667+
- **Omit field entirely**: Keeps existing settings unchanged
668+
- **Include only `enabled`**: Toggles notifications on/off while preserving all other config
669+
- **Include any field**: Updates specified fields, preserves others (auth not re-required)
670+
- **Remove completely**: Send `{"enabled": false}` with no other fields
656671
657672
**Common operations:**
658673
```json
659-
// Enable notifications (must provide webhook on first enable)
660-
{"enabled": true, "webhook": "https://webhook.example.com/events"}
674+
// Enable notifications (preserves webhook, filter, auth)
675+
{"enabled": true}
661676
662-
// Disable temporarily (preserves all config for re-enabling later)
663-
{"enabled": false}
677+
// Disable temporarily (keeps all config for later)
678+
{"enabled": false, "webhook": "https://..."}
664679
665-
// Update webhook while keeping enabled state
666-
{"enabled": true, "webhook": "https://new-endpoint.com"}
680+
// Update webhook only (preserves auth, filter)
681+
{"webhook": "https://new-endpoint.com"}
667682
668-
// Change filter only
669-
{"enabled": true, "filter": "size > 1000000"}
683+
// Change auth type (replaces entire auth object)
684+
{"auth": {"token": "new-token"}}
670685
671686
// Remove all notifications
672687
{"enabled": false}
@@ -679,8 +694,7 @@ components:
679694
enabled:
680695
type: boolean
681696
description:
682-
Enable or disable notifications. When true, webhook must be
683-
provided.
697+
Enable or disable notifications (webhook required when true)
684698
webhook:
685699
type: string
686700
format: uri
@@ -731,6 +745,8 @@ components:
731745
If set to true, per object ACL will be enabled. Default is false.
732746
object_notifications:
733747
$ref: "#/components/schemas/ObjectNotifications"
748+
regions:
749+
$ref: "#/components/schemas/Regions"
734750
UpdateBucketResponse:
735751
type: object
736752
DeleteBucketResponse:
@@ -936,6 +952,8 @@ components:
936952
description: If set to true, the bucket is publicly accessible
937953
storage_class:
938954
$ref: "#/components/schemas/StorageClass"
955+
regions:
956+
$ref: "#/components/schemas/Regions"
939957
object_acl_enabled:
940958
type: boolean
941959
description: If set to true, per object ACL is enabled
@@ -1043,13 +1061,12 @@ components:
10431061
role:
10441062
type: string
10451063
description: |
1046-
The role assigned to the access key defines the permissions (read,
1047-
write, admin) for the associated bucket.
1064+
The role defines the permissions for the associated bucket:
10481065
10491066
- `ReadOnly`: Read-only access to the bucket.
10501067
- `Editor`: Read and write access to the bucket.
1051-
- `Admin`: Full access to all the buckets in org, including management of
1052-
permissions. Since, this access key manages all the buckets, the value of `bucket_name`
1068+
- `Admin`: Full access to all the buckets in the org, including management of
1069+
permissions. Since this access key manages all the buckets, the value of `bucket_name`
10531070
field should always be `*`.
10541071
10551072
Example:
@@ -1177,6 +1194,8 @@ components:
11771194
If set to false, the organization will be deactivated and no new
11781195
resources can be provisioned. Existing resources will be
11791196
inaccessible.
1197+
org_quota:
1198+
$ref: "#/components/schemas/OrgQuota"
11801199
UpdateOrganizationResponse:
11811200
type: object
11821201
ListOrganizationsResponse:
@@ -1202,10 +1221,19 @@ components:
12021221
active:
12031222
type: boolean
12041223
description: If set to false, the organization is deactivated
1224+
quota:
1225+
$ref: "#/components/schemas/OrgQuota"
12051226
StorageClass:
12061227
type: string
12071228
description: Storage class for the bucket. Default is `STANDARD`.
12081229
enum: [STANDARD, STANDARD_IA, GLACIER, GLACIER_IR]
1230+
Regions:
1231+
type: string
1232+
description:
1233+
Restricts the regions where bucket data is stored. Default is empty,
1234+
which means no restrictions. See
1235+
https://www.tigrisdata.com/docs/objects/object_regions/ for more
1236+
details.
12091237
GenericError:
12101238
type: object
12111239
properties:
@@ -1238,33 +1266,33 @@ components:
12381266
type: apiKey
12391267
in: header
12401268
name: X-Tigris-Nonce
1241-
description:
1242-
Random unique string to identifying the request and prevent replay
1243-
attacks. Ex - "f8d133cb-5a42-47b1-9ef2-874bb55bab72"
1269+
description: |
1270+
Random unique string to identify the request and prevent replay attacks. Example: "f8d133cb-5a42-47b1-9ef2-874bb55bab72"
12441271
Timestamp:
12451272
type: apiKey
12461273
in: header
12471274
name: X-Tigris-Time
1248-
description: Unix timestamp in millis of the request. Ex - 1731703213870
1275+
description: |
1276+
Unix timestamp in milliseconds of the request. Example: 1731703213870
12491277
Signature:
12501278
type: apiKey
12511279
in: header
12521280
name: X-Tigris-Signature
12531281
description: |
1254-
HMAC-SHA256 of the request method, url, along with the unique nonce and timestamp signed using signing key.
1255-
To create the signature, concatenate the method, url, nonce, and timestamp with a newline character in between.
1256-
Then, calculate the HMAC-SHA256 of the concatenated string using the signing key. Ex -
1282+
HMAC-SHA256 of the canonical request signed using the signing key.
1283+
To create the signature, concatenate the HTTP method, URL, timestamp, and nonce with a newline character in between.
1284+
Then, calculate the HMAC-SHA256 of the concatenated string using the signing key. Example:
12571285
1258-
Created `canonical_request` as:
1286+
Create the `canonical_request` as:
12591287
```
12601288
POST
1261-
https://fly.mgnt.storage.tigris.dev/provider/laravel/orgs/my-org/provision
1289+
https://mgmt.storage.dev/provider/your-provider-id/orgs/user-org-id/provision
12621290
1731703213870
12631291
f8d133cb-5a42-47b1-9ef2-874bb55bab72
12641292
```
12651293
Then, calculate HMAC-SHA256 of the canonical request using the signing key as:
12661294
```
1267-
Signature = hex(sha256sign(canonical_request, "signing key"))
1295+
Signature = hex(sha256sign(canonical_request, "signing_key"))
12681296
```
12691297
security:
12701298
- Signature: []

0 commit comments

Comments
 (0)