Skip to content

Commit

Permalink
Add support for temporary urls
Browse files Browse the repository at this point in the history
  • Loading branch information
hedii committed Oct 12, 2020
1 parent 185c537 commit 9c054fe
Show file tree
Hide file tree
Showing 9 changed files with 382 additions and 195 deletions.
25 changes: 13 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
language: php
php:
- 7.4
- 7.4
before_script:
- composer self-update
- composer install
- composer self-update
- composer install
script:
- composer test
- composer test
matrix:
fast_finish: true
env:
global:
- secure: ggxLIhqoMh6KmERMgFoxuP8S4Ne+XRw4ieiRO1dr6VBKsXpSymgAUTBsld/L9HsXA5rlqCi2aboxwlHXSX/DZMmRHN8+ofQfQD/3wkMDw2OV3YOcMABQ8Dua74uygSLQdv+zRsCH2jhf1qafGOI8jTv5smGM49Pr/R/Tne0xrZQhA9L68tqafNRfxWxtxAmtjloClNJcl2p/MEVscdczeb319I/8tlac3zSITNxB724/+2akxvUUhMmr0Yjy5Hem4W+DHWGT/EnExb+6rwAN1icZb+RHeBIpTGFrFlhQ1JM7ntc/3QVhFkZhEYrkdTwCPseZSNr+13HaupDR9M5fjCu9MM/Qq8M+yU9rtlJWQ+FdJYYvHVL91GIYH8pUn4oYph0t6ncFBCx7y5QWN27fG/ey2JSiY7rwxVb+PCfLdI9ljgJ14Zy5QfszjrIcy6iCXdTiYIaWSn//iFPAwql6lrn49kHIv5CbNv9Eo+XMUpW2yUEh79iSinUtAo8yyh7eipEoo1O7W5msDAX+x+S2Kdp2+RX3laAQj2O2YDYyvCncPx4SZPSDLsWDglWAOvhjh1nMOa8mAEYyyQ70CRnx1V9d1wBKQirICzsnGGNl6wfNSmhxMh7tA2hBFLPHKIRvtf8GQcgMo29Zpa2ko37bzdAOIpiGoJOA0nMmutjQqFk=
- secure: Mmj7auE+Ate7tOnpkWNF8hE63Bg9RKs0m5b/ilL3HXAfsCciL7BHnGrBre7bH9tDnzHhVYa3nFyzPRbiC8mkmviu4JzS278sRjfjTWSSgO9u9uXkRYa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bcjtn2bNNS2bGEM65H4uA9uQm6n5LSsfMCaFVfKpqccGCs3xBrX+tlu2xbu1iRL8ZLKl79uaKvhEpBJKU7E1I=
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ return [
'password' => env('OVH_SWIFT_OPENSTACK_PASSWORD'),
'visibility' => env('OVH_SWIFT_VISIBILITY', 'public'),
'publicUrl' => env('OVH_SWIFT_PUBLIC_URL'),
'urlKey' => env('OVH_SWIFT_URL_KEY'),
],

],
Expand All @@ -61,19 +62,47 @@ OVH_SWIFT_OPENSTACK_PASSWORD=xxxxxxxxxxxxxxxxxxx

Once you have modified the Laravel filesystem configuration and the environment variables, you can use the new Ovh Swift storage disk [as any Laravel storage disk](https://laravel.com/docs/6.x/filesystem#obtaining-disk-instances).

### Private containers

By default, this package assumes you are using a public Object Storage container.

If you want to use a private container with temporary urls, you have to configure a [temporary url key](https://docs.ovh.com/ie/en/public-cloud/share_an_object_via_a_temporary_url/) and set the visibility to `private`.

```
OVH_SWIFT_OPENSTACK_REGION=GRA
OVH_SWIFT_OPENSTACK_PROJECT_ID=xxxxxxxxxxxxxxxxxxx
OVH_SWIFT_CONTAINER_NAME=xxxxxxxxxxxxxxxxxxx
OVH_SWIFT_OPENSTACK_USERNAME=xxxxxxxxxxxxxxxxxxx
OVH_SWIFT_OPENSTACK_PASSWORD=xxxxxxxxxxxxxxxxxxx
OVH_SWIFT_VISIBILITY=private
OVH_SWIFT_URL_KEY=xxxxxxxxxxxxxxxxxxx
```

Be aware you will not be able to retrieve regular urls with a private container, only temporary urls.

### Example

```php
use Illuminate\Support\Facades\Storage;

Storage::disk('ovh-swift')->put('avatars/1', $fileContents);

$url = Storage::url('avatars/1');

// if using private containers:
$temporaryUrl = Storage::temporaryUrl('avatars/1', now()->addMinute());
```

## Testing

If you want to test the package, you must create a new Ovh Object Storage container and a new Openstack user. Once it's done, copy `phpunit.xml.dist` to `phpunit.xml` and update the environment variables.
If you want to test the package, you must create a new Openstack user and two new Ovh Object Storage containers:

- A public container named `test`
- A private container named `test-private`

Once it's done, copy `phpunit.xml.dist` to `phpunit.xml` and update the environment variables.

Be aware that the test suite will delete all files in the container after each test. **Do not test against a production container!**
Be aware that the test suite will delete all files in the containers after each test. **Do not test against a production containers!**

To start test suite, run this command:

Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<env name="OVH_SWIFT_OPENSTACK_USERNAME" value=""/>
<env name="OVH_SWIFT_OPENSTACK_PASSWORD" value=""/>
<env name="OVH_SWIFT_VISIBILITY" value="public"/>
<env name="OVH_SWIFT_URL_KEY" value=""/>
-->
</php>
</phpunit>
72 changes: 62 additions & 10 deletions src/OvhSwiftStorageAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Hedii\LaravelOvhSwiftStorage;

use DateTimeInterface;
use Illuminate\Support\Str;
use Nimbusoft\Flysystem\OpenStack\SwiftAdapter;
use OpenStack\Common\Transport\Utils;
use OpenStack\ObjectStore\v1\Models\Container;
Expand All @@ -10,22 +12,45 @@
class OvhSwiftStorageAdapter extends SwiftAdapter
{
/**
* The container public url.
* The container url.
*
* @var null|string
* @var string
*/
protected ?string $publicUrl;
protected string $containerUrl;

/**
* The container visibility.
*
* @var string
*/
protected string $visibility;

/**
* The url key used for temporary urls.
*
* @var string|null
*/
protected ?string $urlKey;

/**
* OvhSwiftStorageAdapter constructor.
*
* @param \OpenStack\ObjectStore\v1\Models\Container $container
* @param string $containerUrl
* @param string $visibility
* @param string|null $prefix
* @param string|null $publicUrl
* @param string|null $urlKey
*/
public function __construct(Container $container, ?string $prefix = null, ?string $publicUrl = null)
{
$this->publicUrl = $publicUrl;
public function __construct(
Container $container,
string $containerUrl,
string $visibility,
?string $prefix = null,
?string $urlKey = null
) {
$this->containerUrl = $containerUrl;
$this->visibility = $visibility;
$this->urlKey = $urlKey;

parent::__construct($container, $prefix);
}
Expand All @@ -35,13 +60,40 @@ public function __construct(Container $container, ?string $prefix = null, ?strin
*
* @param string $path
* @return string
* @throws \RuntimeException
*/
public function getUrl(string $path): string
{
if (! $this->publicUrl) {
throw new RuntimeException('This disk does not support retrieving URLs.');
if ($this->visibility !== self::VISIBILITY_PUBLIC) {
throw new RuntimeException('This driver does not support retrieving URLs because the visibility is not public. Please use temporary URLs.');
}

return Utils::normalizeUrl($this->containerUrl) . $path;
}

/**
* Get a temporary URL for the file at the given path.
*
* @param string $path
* @param \DateTimeInterface $expiration
* @param array $options
* @return string
* @throws \RuntimeException
*/
public function getTemporaryUrl(string $path, DateTimeInterface $expiration, array $options = []): string
{
if ($this->visibility !== self::VISIBILITY_PRIVATE) {
throw new RuntimeException('This driver does not support creating temporary URLs because the visibility is not private. Please use regular URLs.');
} elseif (! $this->urlKey) {
throw new RuntimeException('This driver does not support creating temporary URLs because no temp url key has been configured.');
}

return Utils::normalizeUrl($this->publicUrl) . $path;
$expiration = $expiration->getTimestamp();
$pathWithoutHost = Str::after($this->containerUrl, parse_url($this->containerUrl, PHP_URL_HOST)) . "/{$path}";
$body = sprintf("%s\n%s\n%s", 'GET', $expiration, $pathWithoutHost);
$signature = hash_hmac('sha1', $body, $this->urlKey);

return Utils::normalizeUrl($this->containerUrl)
. "{$path}?temp_url_sig={$signature}&temp_url_expires={$expiration}";
}
}
Loading

0 comments on commit 9c054fe

Please sign in to comment.