Skip to content

Commit 0f58157

Browse files
Merge pull request #318 from rsyracuse/limited-access-keys
[Update] Limited access keys with Object Storage
2 parents 8cb7f54 + 9d4a433 commit 0f58157

File tree

1 file changed

+67
-23
lines changed

1 file changed

+67
-23
lines changed

openapi.yaml

Lines changed: 67 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10741,31 +10741,28 @@ paths:
1074110741
security:
1074210742
- personalAccessToken: []
1074310743
- oauth:
10744-
- object_storage:read_only
10744+
- object_storage:read_write
1074510745
requestBody:
1074610746
description: >
1074710747
The label of the key to create. This is used to identify the created key.
1074810748
content:
1074910749
application/json:
1075010750
schema:
10751-
type: object
10752-
properties:
10753-
label:
10754-
type: string
10755-
description: The label for this keypair, for display purposes only.
10756-
example: my-key
10751+
$ref: '#/components/schemas/ObjectStorageKey'
1075710752
responses:
1075810753
'200':
1075910754
description: The new keypair. **This is the only time** the secret key is returned.
1076010755
content:
1076110756
application/json:
1076210757
schema:
1076310758
allOf:
10764-
- $ref: '#/components/schemas/ObjectStorageKey'
10765-
- type: object
10766-
properties:
10767-
secret_key:
10768-
example: OiA6F5r0niLs3QA2stbyq7mY5VCV7KqOzcmitmHw
10759+
- $ref: '#/components/schemas/ObjectStorageKey'
10760+
- type: object
10761+
properties:
10762+
secret_key:
10763+
type: string
10764+
description: This keypair’s secret key. **Only returned on key creation**.
10765+
example: OiA6F5r0niLs3QA2stbyq7mY5VCV7KqOzcmitmHw
1076910766
default:
1077010767
$ref: '#/components/responses/ErrorResponse'
1077110768
x-code-samples:
@@ -10774,13 +10771,26 @@ paths:
1077410771
curl -H "Content-Type: application/json" \
1077510772
-H "Authorization: Bearer $TOKEN" \
1077610773
-X POST -d '{
10777-
"label": "my-object-storage-key"
10778-
}' \
10779-
https://api.linode.com/v4/object-storage/keys
10774+
"label": "my-object-storage-key",
10775+
"bucket_access": [
10776+
{
10777+
"cluster": "ap-south-1",
10778+
"bucket_name": "bucket-example-1",
10779+
"permissions": "read_write"
10780+
},
10781+
{
10782+
"cluster": "us-east-1",
10783+
"bucket_name": "bucket-example-2",
10784+
"permissions": "read_only"
10785+
}
10786+
]
10787+
}' \
10788+
https://api.linode.com/v4/object-storage/keys
1078010789
- lang: CLI
1078110790
source: >
1078210791
linode-cli object-storage keys-create \
10783-
--label "my-object-storage-key"
10792+
--label "my-object-storage-key" \
10793+
--bucket_access '[{"cluster": "ap-south-1", "bucket_name": "bucket-example-1", "permissions": "read_write" }]'
1078410794
/object-storage/keys/{keyId}:
1078510795
x-linode-cli-command: object-storage
1078610796
parameters:
@@ -10841,7 +10851,12 @@ paths:
1084110851
content:
1084210852
application/json:
1084310853
schema:
10844-
$ref: '#/components/schemas/ObjectStorageKey'
10854+
type: object
10855+
properties:
10856+
label:
10857+
type: string
10858+
description: The label for this keypair, for display purposes only.
10859+
example: my-key
1084510860
responses:
1084610861
'200':
1084710862
description: Update Successful
@@ -10856,7 +10871,7 @@ paths:
1085610871
source: >
1085710872
curl -H "Content-Type: application/json" \
1085810873
-H "Authorization: Bearer $TOKEN" \
10859-
-x PUT -d '{
10874+
-X PUT -d '{
1086010875
"label": "my-object-storage-key"
1086110876
}' \
1086210877
https://api.linode.com/v4/object-storage/keys/12345
@@ -10892,7 +10907,7 @@ paths:
1089210907
- lang: Shell
1089310908
source: >
1089410909
curl -H "Authorization: Bearer $TOKEN" \
10895-
-x DELETE \
10910+
-X DELETE \
1089610911
https://api.linode.com/v4/object-storage/keys/12345
1089710912
- lang: CLI
1089810913
source: >
@@ -17756,11 +17771,40 @@ components:
1775617771
description: This keypair's access key. This is not secret.
1775717772
example: KVAKUTGBA4WTR2NSJQ81
1775817773
readOnly: true
17759-
secret_key:
17760-
type: string
17761-
description: This keypair's secret key. **Only returned on key creation**.
17762-
example: '[REDACTED]'
17774+
limited:
17775+
type: boolean
17776+
description: Whether or not this key is a limited access key. Will return `false` if this key grants full access to all buckets on the user's account.
17777+
example: true
1776317778
readOnly: true
17779+
bucket_access:
17780+
type: array
17781+
description: >
17782+
Defines this key as a Limited Access Key. Limited Access Keys restrict this Object Storage key's access to only the bucket(s) declared in this array and define their bucket-level permissions.
17783+
17784+
17785+
Limited Access Keys can:
17786+
17787+
* [list all buckets](/api/v4/object-storage-buckets/) available on this Account, but cannot perform any actions on a bucket unless it has access to the bucket.
17788+
17789+
* [create new buckets](/api/v4/object-storage-buckets/#post), but do not have any access to the buckets it creates, unless explicitly given access to them.
17790+
items:
17791+
type: object
17792+
properties:
17793+
cluster:
17794+
type: string
17795+
description: The Object Storage cluster where a bucket to which the key is granting access is hosted.
17796+
example: ap-south-1
17797+
bucket_name:
17798+
type: string
17799+
description: The unique label of the bucket to which the key will grant limited access.
17800+
example: example-bucket
17801+
permissions:
17802+
type: string
17803+
enum:
17804+
- read_write
17805+
- read_only
17806+
description: This Limited Access Key's permissions for the selected bucket.
17807+
example: read_only
1776417808
PaginationEnvelope:
1776517809
type: object
1776617810
description: >

0 commit comments

Comments
 (0)