Page MenuHomePhabricator

Add a native S3 client
Changes PlannedPublic

Authored by joshuaspence on Sep 21 2014, 9:43 AM.
Tags
None
Referenced Files
F14075062: D10530.diff
Thu, Nov 21, 9:38 AM
Unknown Object (File)
Sun, Nov 17, 8:03 AM
Unknown Object (File)
Wed, Oct 30, 7:18 AM
Unknown Object (File)
Oct 22 2024, 1:55 AM
Unknown Object (File)
Oct 18 2024, 8:05 PM
Unknown Object (File)
Oct 18 2024, 3:50 PM
Unknown Object (File)
Sep 27 2024, 3:19 PM
Unknown Object (File)
Sep 12 2024, 6:27 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.