Public Cloud - Problem - Temporary access to files
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

Problem - Temporary access to files

Von
JakubR
Erstellungsdatum 2019-09-18 09:34:40 (edited on 2024-09-04 14:24:39) in Public Cloud

## What I have / What I need:

- OVH Object Storage - private
- Granting access to (mostly) videos for a limited time (temporary Url)
- Kill temporary Url (not required)


## How it works in my project (short version):

- Client (ReactApp) makes a call to my API (wants to access the file)
- My server checks if the user has access (if no - returns error)
- Server generates temporary URL and send response with it to APP (and kills prev tempUrl - if possible, not required)


## What I've tried (PHP code):

(I'm using Laravel Framework with OpenCloud\OpenStack)
My code:

[...]
$client = new OpenStack('https://auth.cloud.ovh.net/v2.0/', [
'username' => '',
'password' => '',
'tenantId' => '',
'tenantName' => "",
]);
$service = $client->objectStoreService('swift', 'WAW1', 'publicURL');
$container = $service->getContainer('');
$object = $container->getPartialObject('');
$url = $object->getTemporaryUrl(530, 'GET', true);
[...]


## Problems / Questions:

- Is it good solution in my case? (if not, which solution should be used)
- I'm waiting 3-5s (on my localhost server) to get response with TempURL (how to make better performance?)
- Can I kill prev temporary URL?
- When I'm using "$object->getTemporaryUrl(530, 'GET', true)" the value (in this example: 530) must be higher than 300/400. If I set this value to 300 and try to use generated URL (instantly after i get response) it returns "401 Unauthorized: Temp URL invalid". Is it problem with time/timezone synchronization or what?


Antworten sind derzeit für diese Frage deaktiviert.