0

I am using IBM's SoftLayer Object Storage which is similar to Amazon's S3.

From my web app, I allow users to upload files. Currently the web app communicates with my RESTful API which then communicates with the SoftLayer Object Storage API. Communication with SoftLayer requires a username and a key -- these are meant to be secret.

Because upload files can be large, I want to to bypass my API and communicate with SoftLayer directly from my web app. I believe this is possible, but the problem is that then I will expose my username and secret key via my application's publicly visible source in JavaScript.

Is there any way around this with SoftLayer?

It seems something like this is possible with S3:

Floern
  • 31,495
  • 23
  • 98
  • 115
Chad Johnson
  • 18,956
  • 30
  • 98
  • 192
  • I am looking desperately on how to use softlayer object storage, especially direct uploading... would you like to share some code here! I will be thankful – medBouzid Jun 15 '16 at 21:32

1 Answers1

1

You can generate a token which is valid for 24 hours and it eliminates the need of using the credentials on every call.

You can use this "token" to Get/Create/Delete containers, files through REST APIs.

See "Authenticating to the Object Storage" section in the following link:

Managing SoftLayer Object Storage Through REST APIs

Also, you will find in this link, more information about using SoftLayer Object Storage through REST APIs.

  • Nice. So I could have my API request this token and pass it back to my web app, and then my web app would never need to know the username or key. – Chad Johnson Feb 24 '16 at 19:25
  • Also note that setting "X-Container-Meta-Access-Control-Allow-Origin" on the container is necessary. Additionally, SoftLayer uses OpenStack/Swift, so OpenStack/Swift libraries should be compatible with SoftLayer. – Chad Johnson Feb 28 '16 at 16:53
  • You can find more information here: [Object Storage API overview](http://docs.openstack.org/developer/swift/api/object_api_v1_overview.html), if you got any particular issue, let me know – Ruber Cuellar Valenzuela Feb 29 '16 at 16:59