Skip to content

Add POST, GET, and DELETE Object Storage SSL Cert #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 163 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11717,6 +11717,135 @@ paths:
- lang: CLI
source: >
linode-cli object-storage cancel
/object-storage/buckets/{clusterId}/{bucket}/ssl:
x-linode-cli-command: object-storage
parameters:
- name: clusterId
in: path
description: The ID of the cluster this bucket exists in.
required: true
schema:
type: string
- name: bucket
in: path
description: The bucket name.
required: true
schema:
type: string
get:
operationId: getObjectStorageSSL
x-linode-cli-action: ssl-view
servers:
- url: https://api.linode.com/v4
summary: View Object Storage SSL Cert
description: |
Returns a boolean value indicating if this bucket has a corresponding SSL certificate that was
uploaded by an Account user.
tags:
- Object Storage
security:
- personalAccessToken: []
- oauth:
- object_storage:read_only
responses:
'200':
description: >
Returns a boolean value indicating if this bucket has a corresponding SSL certificate that was
uploaded by an Account user.
content:
application/json:
schema:
$ref: '#/components/schemas/ObjectStorageSSLResponse'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/object-storage/buckets/us-east-1/example-bucket/ssl
- lang: CLI
source: >
linode-cli object-storage ssl-view \
us-east-1 example-bucket
post:
operationId: createObjectStorageSSL
x-linode-cli-action: ssl-upload
servers:
- url: https://api.linode.com/v4
summary: Upload Object Storage SSL Cert
description: |
Upload an SSL certificate and private key to be served when you visit your Object Storage bucket via HTTPS.
Your SSL certificate and private key are stored encrypted at rest.
tags:
- Object Storage
security:
- personalAccessToken: []
- oauth:
- object_storage:read_write
requestBody:
description: Upload this SSL certificate with its corresponding secret key.
content:
application/json:
schema:
$ref: '#/components/schemas/ObjectStorageSSL'
responses:
'200':
description: Returns whether this bucket has a corresponding SSL certificate that was uploaded by a user.
content:
application/json:
schema:
$ref: '#/components/schemas/ObjectStorageSSLResponse'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just put up a PR to change this a bit. It's kind of a pain to have to strip newlines to fit PEM certs within a json string, so instead we'll be accepting the certificate and key as file inputs, similar to how we accept support ticket attachments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adammohammed I added some info about being able to also upload a .crt file. If this feature doesn't get added, I'll revert the commit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leslitagordita Yeah looks like if we add this we'll have to do the same for node balancers. So I think let's revert it for now. Those changes will have to come later.

curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d ‘{
"certificate": """-----BEGIN CERTIFICATE-----MIIDbDCCAlQCCQCl-----END CERTIFICATE-----""",
"private_key": "RwtqMlXveYH531g770BBNluAk9s"
}’ \
https://api.linode.com/v4/object-storage/buckets/us-east-1/example-bucket/ssl
- lang: CLI
source: >
linode-cli object-storage ssl-upload \
us-east-1 example-bucket \
--certificate """-----BEGIN CERTIFICATE-----MIIDbDCCAlQCCQCl-----END CERTIFICATE-----""" \
--private_key "RwtqMlXveYH531g770BBNluAk9s"
delete:
operationId: getObjectStorageSSL
x-linode-cli-action: ssl-delete
servers:
- url: https://api.linode.com/v4
summary: Delete Object Storage SSL Cert
description: |
Deletes this Object Storage bucket's user uploaded SSL certificate and private key.
tags:
- Object Storage
security:
- personalAccessToken: []
- oauth:
- object_storage:read_write
responses:
'200':
description: Deletes this Object Storage bucket's user uploaded SSL certificate and private key.
content:
application/json:
schema:
type: object
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
-X DELETE \
https://api.linode.com/v4/object-storage/buckets/us-east-1/example-bucket/ssl
- lang: CLI
source: >
linode-cli object-storage ssl-delete \
us-east-1 example-bucket
/profile:
x-linode-cli-command: profile
get:
Expand Down Expand Up @@ -18834,6 +18963,40 @@ components:
- read_only
description: This Limited Access Key's permissions for the selected bucket.
example: read_only
ObjectStorageSSL:
type: object
required:
- certificate
- private_key
description: >
Upload an SSL certificate and private key to be served when you visit your Object Storage bucket via HTTPS.
properties:
certificate:
type: string
description: >
Your Base64 encoded and PEM formatted SSL certificate. Upload your
certificate as a JSON string or as a `.crt` file.
example: >
"""-----BEGIN CERTIFICATE-----
MIIFTTCCAzWgAwIBAgIURwtqMlXveYH531g770BBNluAk9swDQYJKoZIhvcNAQEL
D79A2svTqSsN+bDIVWoUd14=
-----END CERTIFICATE-----"""
private_key:
type: string
description: >
The private key associated with this SSL certificate.
example: RwtqMlXveYH531g770BBNluAk9s
ObjectStorageSSLResponse:
type: object
description: >
If this Object Storage bucket has a corresponding SSL Certificate.
properties:
ssl:
type: boolean
description: >
A boolean indicating if this Bucket has a corresponding SSL certificate that was uploaded by an Account user.
example: true
readOnly: true
PaginationEnvelope:
type: object
description: >
Expand Down