node package manager

rackspace-cloudfiles-url-signer

Module to sign urls to allow access to the private blobs in rackspace cloud files

Module to sign urls to allow access to the private blobs in rackspace cloud files

npm install rackspace-cloudfiles-url-signer
var sig= require('rackspace-cloudfiles-url-signer');

var account1 = sig.urlSigner('myusername', 'apikey');
var account2 = sig.urlSigner('myotherusername', 'apikey2');

var url1 = account1.getUrl('GET', 'mycontainer', 'somefile.png', 10); //url expires in 10 minutes
var url2 = account2.getUrl('PUT', 'mycontaineronotheraccount', '/somedir/somefile.png', 1); //url expires in 1 minute

//Works with containers too!
var url2 = account1.getUrl('GET', 'mycontainer', null, 10);
  • Rackspace relies on using a TempURL key that is attached to the metadata of your account. If you don't already have a TempKey set up, the library will generate (and save) one for you
  • The source code is reasonably short and resonably commented, so read it if you have questions

Inspired by and derived from amazon-s3-url-signer.

BSD, because that's what amazon-s3-url-signer is.