1

I have an application that allows users to customize a website with CSS and other items. Upon the creation of these files, they are stored on Amazon S3 as being publicly readable. Therefore I have always been able refer to them with a static url that did not require me to first connect to S3 to generate a URL.

We have moved all of the files to an EMC Atmos system that is located within our hosting company's datacenter. I know how to generate shareable URLs from Atmos, but only by first establishing a connection. Is there a way on Atmos to set system metadata on an object so that it can be referred to with a static URL?

RubyRedGrapefruit
  • 12,066
  • 16
  • 92
  • 193

2 Answers2

1

You don't need to connect to Atmos to generate a shareable URL. The generation of the shareable URL always happens client-side; it doesn't happen over HTTP.

Atmos system metadata is always immutable. You can generate a "static URL" using a shareable URL with an expiration set to something in the distant future.

Raj
  • 3,791
  • 5
  • 43
  • 56
  • Unfortunately in the Ruby interface, get_shareable_url is an instance method. – RubyRedGrapefruit Aug 16 '12 at 18:20
  • Can you clarify how that causes a problem? get_shareable_url() is an instance method, but it doesn't actually connect to Atmos to generate the shareable URL. The shareable URL is pre-signed; It all happens within the wrapper itself. – Raj Aug 16 '12 at 21:57
  • Maybe it's not a problem. It's just that instantiating the EsusRestApi object calls this line: @session = Net::HTTP.new( host, port ).start which looks like some sort of session is being established. – RubyRedGrapefruit Aug 17 '12 at 14:33
  • It has to build the URI to return the pre-signed URL, but if you notice it doesn't actually call build_request() or @session.request() like it does for the other methods that actually send requests over HTTP. – Raj Aug 17 '12 at 19:54
  • But this is the first line in the get_shareable_url method: uri = URI::HTTP.build( {:host => \@host, :port => \@port, :path => build_resource(id) }) – RubyRedGrapefruit Aug 20 '12 at 18:42
  • 1
    Trust me: it's not sending an HTTP request to Atmos to generate a shareable URL. Run Wireshark/Fiddler/Charles to see for yourself. It has to use the host, port, etc in order to return a shareable URL to you with those components, but it doesn't interact over HTTP to create the URL. – Raj Aug 28 '12 at 02:02
0

EMC Atmos does not need an HTTP/HTTPS connection to generate a shareable URL. It does make an HTTP connection to generate the file, but it can be done by the end user of the file stored on the cloud.

To create the URL, a signature is made on the application client-side (no HTTP connection needed). The reason is because a unique signature is generated.

To send the signature, you either put the signature in the URL:

$url = "http://$server$resource?uid=$uid&expires=$expires&signature=$signature";

Or instead of putting the signature in the URL, you send it through the REST API by posting an HTTP header of x-emc-signature.

So, once you have that URL generated, you can send it to somebody else via an email or text, which they can click on later and it will be valid, as long as the URL has not expired.

Once EMC Atmos verifies the signature, it sends the download to the client. Note that a server with a system clock that is off by more than five minutes will have problems generating shareable URL's, so keep the time in sync on the application generating the shareable URL's by using an NTP daemon.

So, to clarify, EMC Atmos does not need an HTTP connection to your cloud storage provider. The HTTP connection is done when the file is first requested. At that point the file becomes available publicly.

taco
  • 1,367
  • 17
  • 32