Skip to content
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

upcoming: [M3-8296] - APIv4, Validation & Endpoints for OBJGen2 #10677

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

jaalah-akamai
Copy link
Contributor

@jaalah-akamai jaalah-akamai commented Jul 15, 2024

Description 📝

Under this proposal, Cloud Manager uses this to determine which S3 endpoints or types of endpoints are available to the requesting customer when using the API to create a bucket in a particular region.

Changes 🔄

  • Added new /v4/object-storage/endpoints
{
  region: string;
  endpoint_type: 'E0' | 'E1' | 'E2' | 'E3';
  s3_endpoint: string | null;
}
  • Modified Access Key Endpoint (GET)
    • regions array will contain new endpoint_type field
  • Modified Create Bucket Request (POST)
    • Cloud Manager currently omits cors_enabled upon creation because it defaults to true. This behavior should be updated to explicitly set cors_enabled to either true or false.
  • Added new fields to Modify Bucket Response (GET)
    • s3_endpoint and endpoint_type
  • Modified Bucket Access (GET)
    • If Gen2 is enabled, the values for cors_enabled and cors_xml will be null

Note

When the new API features are disabled, this endpoint will silently ignore any new request fields, even if they are present and non-null. APIv4 will safely discard these fields instead of passing them to OSA.

Target release date 🗓️

N/A

Preview 📷

No visual changes

How to test 🧪

No testing to be done, just review the endpoint, spelling, and typescript types
When reviewing, compare type to the API specification linked on the internal ticket

@jaalah-akamai jaalah-akamai self-assigned this Jul 15, 2024
@jaalah-akamai jaalah-akamai added @linode/api-v4 Changes are made to the @linode/api-v4 package @linode/validation Changes are made to the @linode/validation package Object Storage Gen2 labels Jul 15, 2024
@jaalah-akamai jaalah-akamai changed the title upcoming: [M3-8296] - APIv4, Validation, Factories & Endpoints for OBJGen2 upcoming: [M3-8296] - APIv4, Validation & Endpoints for OBJGen2 Jul 15, 2024
@jaalah-akamai jaalah-akamai marked this pull request as ready for review July 15, 2024 16:48
@jaalah-akamai jaalah-akamai requested a review from a team as a code owner July 15, 2024 16:48
@jaalah-akamai jaalah-akamai requested review from bnussman-akamai and AzureLatte and removed request for a team July 15, 2024 16:48
if (typeof cors_enabled === 'boolean') {
setCORSData(cors_enabled);
setSelectedCORSOption(cors_enabled);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Type guard needed based on the way this was originally written. We are utilizing getAccess as a general entrypoint for calling getBucketAccess or getObjectACL which have different type signatures. Not a fan, so I may clean up in a future PR.

Copy link

github-actions bot commented Jul 15, 2024

Coverage Report:
Base Coverage: 82.34%
Current Coverage: 82.34%

@jaalah-akamai
Copy link
Contributor Author

jaalah-akamai commented Jul 15, 2024

Looking at both E2E tests 👀

Edit: I see... going to put this back into draft temporarily until I update factories

@jaalah-akamai jaalah-akamai marked this pull request as draft July 15, 2024 17:54
@@ -120,7 +120,7 @@ describe('object storage access key end-to-end tests', () => {
it('can create an access key with limited access - e2e', () => {
const bucketLabel = randomLabel();
const bucketCluster = 'us-east-1';
const bucketRequest = objectStorageBucketFactory.build({
const bucketRequest = createObjectStorageBucketFactory.build({
Copy link
Contributor Author

@jaalah-akamai jaalah-akamai Jul 15, 2024

Choose a reason for hiding this comment

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

Note: This is the start of cleaning up the factories. We were using the response interface as the type signature for the payload which I fixed here.

@jaalah-akamai jaalah-akamai marked this pull request as ready for review July 15, 2024 19:37
@jaalah-akamai jaalah-akamai requested a review from a team as a code owner July 15, 2024 19:37
@jaalah-akamai jaalah-akamai requested review from jdamore-linode and removed request for a team July 15, 2024 19:37
Copy link
Contributor

@AzureLatte AzureLatte left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

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

Didn't observe any issues with Object Storage ✅

@@ -88,16 +89,23 @@ export interface ObjectStorageObjectURL {
url: string;
}

export interface ObjectStorageEndpointsResponse {
Copy link
Member

Choose a reason for hiding this comment

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

Should drop the Response in this type name and make Endpoint singular?

Suggested change
export interface ObjectStorageEndpointsResponse {
export interface ObjectStorageEndpoint {

Copy link
Contributor Author

@jaalah-akamai jaalah-akamai Jul 16, 2024

Choose a reason for hiding this comment

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

Agreed - I'll update

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll actually make this name change in my next PR which deals with semantics.

@jaalah-akamai jaalah-akamai added the Approved Multiple approvals and ready to merge! label Jul 16, 2024
@jaalah-akamai
Copy link
Contributor Author

Waiting to merge until after release is cut ✂️

@jaalah-akamai jaalah-akamai merged commit e60faef into linode:develop Jul 17, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! @linode/api-v4 Changes are made to the @linode/api-v4 package @linode/validation Changes are made to the @linode/validation package Object Storage Gen2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants