Page MenuHomePhabricator

Add a native S3 client
Changes PlannedPublic

Authored by joshuaspence on Sep 21 2014, 9:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 8, 12:05 AM
Unknown Object (File)
Tue, Mar 5, 10:09 PM
Unknown Object (File)
Mon, Mar 4, 1:54 PM
Unknown Object (File)
Feb 14 2024, 7:51 PM
Unknown Object (File)
Feb 8 2024, 1:48 PM
Unknown Object (File)
Jan 14 2024, 12:43 AM
Unknown Object (File)
Jan 13 2024, 8:46 PM
Unknown Object (File)
Dec 20 2023, 1:40 AM

Details

Summary

Fixes T5155. Add a native S3 client that can be used instead of the current external used in rP. This generally gives us a lot more flexibility in how we in invoke the API and allows us to use more advanced features, such as IAM instance profiles.

This diff includes the following changes (I can break this down into smaller chunks if preferred, but seeing as testing this stuff is tricky and manual, it made sense to just lump everything into a single diff):

  • Add support for instance profile credentials to the PhutilAWSFuture class (enabled with ->setUseIAM(true)).
  • Add SSL support to PhutilAWSFuture (enabled with ->setUseSSL(true)).
  • Add a bunch of methods to the PhutilAWSS3Future class.
  • Add a PhutilAWSS3Client which provides around PhutilAWSS3Future and provides a (more convenient) API.
  • Marked a bunch of methods from the PhutilAWSFuture class as final.
Test Plan

I've done some initial testing with the following script:

<?php

require_once __DIR__.'/scripts/__init_script__.php';

$client = id(new PhutilAWSS3Client())
  ->setUseIAM(true);

var_dump($client->listBucket('my-secret-bucket'));

Diff Detail

Repository
rPHU libphutil
Branch
master
Lint
Lint Errors
SeverityLocationCodeMessage
Errorsrc/future/aws/PhutilAWSFuture.php:206XHP5Use of Undeclared Variable
Warningsrc/future/aws/PhutilAWSFuture.php:145TXT3Line Too Long
Warningsrc/future/aws/PhutilAWSFuture.php:235TXT3Line Too Long
Unit
Tests Passed
Build Status
Buildable 3413
Build 3420: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

joshuaspence retitled this revision from to Add a native S3 client.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
hach-que added inline comments.
src/future/aws/PhutilAWSFuture.php
254–256

Setting $this->awsSessionExpiry to null right before comparing it?

Yes. This is still a WIP... I don't really have an easy way to test this stuff, but I expect to come back to it when I do.

Just pulling this back to my queue.