musicformellons / swift-temp-url

A JavaScript implementation of the Swift Temp URL generator script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swift Temp URL

This package contains a function to generate an expiring temporary URL for a file stored in Object Storage.

See openstack temporary URL documentation for more info.

How to use ?

// Example (for OVH openstack Object Storage) :
var swiftTempUrl = require('swift-temp-url');

swiftTempUrl(
  'myContainerName',
  'myObjectName.csv',
  'myTempUrlKey',
  24 * 3600 * 1000,
  'GET',
  'myTenantId',
  'https://storage.sbg1.cloud.ovh.net'
);
// will output : https://storage.sbg1.cloud.ovh.net/v1/AUTH_myTenantId/myContainerName/myObjectName.csv?temp_url_sig=c0d06ff4fc848c72b36626b99bf0752e369db15d&temp_url_expires=1443617620

About

A JavaScript implementation of the Swift Temp URL generator script


Languages

Language:JavaScript 100.0%