consume rest services

Asked by Mahdi Njim

I like to create a web site that display photos stored in Open stack swift, since all the api are written with phyton I thout to use Rest, So I want to write a javascript code using Ajax to get me the image or the ressource but it appears that I can't do any get, because the authentification issues, can I get any help in this matter and thiere is any other alternative solutions to display those photos in the web sites. thanks

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Solved by:
John Dickinson
Solved:
Last query:
Last reply:
Revision history for this message
Best John Dickinson (notmyname) said :
#1

If you are running your own swift cluster, then you can run it without any authentication at all, thus allowing all requests. However, you probably would prefer to have read-only access. This will be dependent on the auth system you use (either your own or someone else's).

As to your concern about how the auth token is passed to the swift cluster (headers are not ideal for your use case since setting headers in browser requests is not possible), you could add a piece of middleware (ie a swift plugin) that translates the auth token from a query parameter to a request header.

Overall, I'd suggest that the best solution would be to use (or write) an auth server that supports read-only accounts with no auth token (as opposed to an auth system that grants read-only rights to a particular token).

Revision history for this message
Mahdi Njim (njimmahdi) said :
#2

The auth server will be a great solution so it will be written with python and give permission for read only files without using looking for a token in the header request. Do I get this right ???