Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-5348

FIWARE.Request.Tech.Cloud.ObjectStorage.Temp url access with object storage

    Details

    • Type: extRequest
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Fix Version/s: 2021
    • Component/s: FIWARE-TECH-HELP
    • Labels:
      None

      Description

      Jose Antonio sent a message using the contact form at
      http://catalogue.fiware.org/.

      I am trying to use the temp url feature in Swift object storage. The use case
      is being able to generate public urls for picture files so that they can be
      shown in my application web page (using html img tag). I've managed to upload
      and download files using curl and my auth token, following the instructions
      in
      http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Object_Storage_-_User_and_Programmers_Guide.

      In order to use temp url feature I've followed the guide in
      http://docs.openstack.org/kilo/config-reference/content/object-storage-tempurl.html.
      I've done the following:

      I've generate the X-Account-Meta-Temp-URL-Key using the command swift
      post -m "X-Account-Meta-Temp-URL-Key:b3968d0207b54ece87cccc06515a89d4".
      I've verified that the temp url key has been successfully saved using
      swift stat command.
      I've generated the temp file url using the tool swift-temp-url. This
      tool
      gives an url with all the parameters needed (temp_url_sig and
      temp_url_expires).
      I've copied the url obtained in the previous step to my browser and
      tried
      to retrieved the file, obtaining a message telling that I am not authorized.
      The same happens using curl.

      What am I doing wrong? I really need to get this feature working in order to
      be able to feed my application with pictures.

      Thank you very much,

      Jose

      Since January 1st, old domains won't be supported and messages sent to any domain different to @lists.fiware.org will be lost.
      Please, send your messages using the new domain (Fiware-tech-help@lists.fiware.org) instead of the old one.
      _______________________________________________
      Fiware-tech-help mailing list
      Fiware-tech-help@lists.fiware.org
      https://lists.fiware.org/listinfo/fiware-tech-help

      [Created via e-mail received from: joanlofe@gmail.com]

        Activity

        Hide
        meth Kalman Meth added a comment -

        According to the documentation on http://docs.openstack.org/kilo/config-reference/content/object-storage-tempurl.html it seems that this feature was introduced in the Kilo release.
        Are you sure that your Swift installation is running Kilo? In the Fiware labs, they are currently running Juno release. An update to Kilo release is planned for the near future for some of the regions.

        • Kalman
        Show
        meth Kalman Meth added a comment - According to the documentation on http://docs.openstack.org/kilo/config-reference/content/object-storage-tempurl.html it seems that this feature was introduced in the Kilo release. Are you sure that your Swift installation is running Kilo? In the Fiware labs, they are currently running Juno release. An update to Kilo release is planned for the near future for some of the regions. Kalman
        Hide
        meth Kalman Meth added a comment -

        In addition, even if running Kilo release, the tempurl feature probably needs to be enabled by having it in the Swift proxy-server pipeline. Can we see the proxy-server conf file? What about the proxy logs?

        Show
        meth Kalman Meth added a comment - In addition, even if running Kilo release, the tempurl feature probably needs to be enabled by having it in the Swift proxy-server pipeline. Can we see the proxy-server conf file? What about the proxy logs?
        Hide
        fw.ext.user FW External User added a comment -

        Hi! Running the command swift capabilities I obtain version version:
        2.5.1.dev134. From the information in this link
        <https://github.com/openstack/swift/blob/master/CHANGELOG> It seems that
        Liberty release included swift 2.5.0, so my version should support temp url
        feature.

        I am using Swift SAIO version, installed according to documentation in this
        link <http://docs.openstack.org/developer/swift/development_saio.html>. The
        proxy server pipeline is the following:

        pipeline = catch_errors gatekeeper healthcheck proxy-logging cache bulk
        tempurl ratelimit crossdomain container_sync tempauth staticweb
        container-quotas account-quotas slo dlo versioned_writes proxy-logging
        proxy-server

        I am not using keystone, I am using tempauth, I do not know if that is ok
        or not.

        The sequence of requests I make are:
        curl -v -H 'X-Auth-User:ubiprint3d:admin' -H 'X-Auth-Key:changeme'
        http://localhost:8080/auth/v1.0/ --> I obtain X-Auth-Token:
        AUTH_tke7ad8b3cbc184d8b9bccd34a5202f933

        curl -v -H 'X-Auth-Token: AUTH_tke7ad8b3cbc184d8b9bccd34a5202f933'
        http://localhost:8080/v1/AUTH_ubiprint3d --> I obtain (as expected)
        X-Account-Meta-Temp-Url-Key: cafebabe

        curl -H 'X-Auth-Token: AUTH_tke7ad8b3cbc184d8b9bccd34a5202f933'
        http://localhost:8080/v1/AUTH_ubiprint3d/ubiprint3d --> returns one line:
        image.jpg (the only one object in container)

        swift-temp-url GET 86400 /v1/AUTH_ubiprint3d/ubiprint3d/image.jpg
        b3968d0207b54ece87cccc06515a89d4 --> returns temp url
        /v1/AUTH_ubiprint3d/ubiprint3d/image.jpg?temp_url_sig=2b66fc0c43f7155f8fb9d0eda28ac0d7e7679f78&temp_url_expires=1448082214

        curl -X GET -v
        http://localhost:8080/v1/AUTH_ubiprint3d/ubiprint3d/image.jpg?temp_url_sig=2b66fc0c43f7155f8fb9d0eda28ac0d7e7679f78&temp_url_expires=1448082214
        --> returns 401 Unauthorized: Temp URL invalid

        What am I doing wrong?


        -------------------------------------------------
        José Antonio Lorenzo Fernández
        email: joanlofe@gmail.com
        -------------------------------------------------

        Show
        fw.ext.user FW External User added a comment - Hi! Running the command swift capabilities I obtain version version: 2.5.1.dev134. From the information in this link < https://github.com/openstack/swift/blob/master/CHANGELOG > It seems that Liberty release included swift 2.5.0, so my version should support temp url feature. I am using Swift SAIO version, installed according to documentation in this link < http://docs.openstack.org/developer/swift/development_saio.html >. The proxy server pipeline is the following: pipeline = catch_errors gatekeeper healthcheck proxy-logging cache bulk tempurl ratelimit crossdomain container_sync tempauth staticweb container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-server I am not using keystone, I am using tempauth, I do not know if that is ok or not. The sequence of requests I make are: curl -v -H 'X-Auth-User:ubiprint3d:admin' -H 'X-Auth-Key:changeme' http://localhost:8080/auth/v1.0/ --> I obtain X-Auth-Token: AUTH_tke7ad8b3cbc184d8b9bccd34a5202f933 curl -v -H 'X-Auth-Token: AUTH_tke7ad8b3cbc184d8b9bccd34a5202f933' http://localhost:8080/v1/AUTH_ubiprint3d --> I obtain (as expected) X-Account-Meta-Temp-Url-Key: cafebabe curl -H 'X-Auth-Token: AUTH_tke7ad8b3cbc184d8b9bccd34a5202f933' http://localhost:8080/v1/AUTH_ubiprint3d/ubiprint3d --> returns one line: image.jpg (the only one object in container) swift-temp-url GET 86400 /v1/AUTH_ubiprint3d/ubiprint3d/image.jpg b3968d0207b54ece87cccc06515a89d4 --> returns temp url /v1/AUTH_ubiprint3d/ubiprint3d/image.jpg?temp_url_sig=2b66fc0c43f7155f8fb9d0eda28ac0d7e7679f78&temp_url_expires=1448082214 curl -X GET -v http://localhost:8080/v1/AUTH_ubiprint3d/ubiprint3d/image.jpg?temp_url_sig=2b66fc0c43f7155f8fb9d0eda28ac0d7e7679f78&temp_url_expires=1448082214 --> returns 401 Unauthorized: Temp URL invalid What am I doing wrong? – ------------------------------------------------- José Antonio Lorenzo Fernández email: joanlofe@gmail.com -------------------------------------------------
        Hide
        fw.ext.user FW External User added a comment -

        I've installed swift version 2.5.0 (the one included in liberty) and
        repeated the process with same result: 401 Unauthorized: Temp URL invalid


        -------------------------------------------------
        José Antonio Lorenzo Fernández
        email: joanlofe@gmail.com
        -------------------------------------------------

        Show
        fw.ext.user FW External User added a comment - I've installed swift version 2.5.0 (the one included in liberty) and repeated the process with same result: 401 Unauthorized: Temp URL invalid – ------------------------------------------------- José Antonio Lorenzo Fernández email: joanlofe@gmail.com -------------------------------------------------
        Hide
        fw.ext.user FW External User added a comment -

        Found the problem!! In the request

        curl -X GET -v
        http://localhost:8080/v1/AUTH_ubiprint3d/ubiprint3d/image.jpg?temp_url_sig=2b66fc0c43f7155f8fb9d0eda28ac0d7e7679f78&temp_url_expires=1448082214

        the HTTP path should be quoted, if not bash splits out all the url after
        the character &

        Silly mistake, I've lost hours solving this.

        Thanks!


        -------------------------------------------------
        José Antonio Lorenzo Fernández
        email: joanlofe@gmail.com
        -------------------------------------------------

        Show
        fw.ext.user FW External User added a comment - Found the problem!! In the request curl -X GET -v http://localhost:8080/v1/AUTH_ubiprint3d/ubiprint3d/image.jpg?temp_url_sig=2b66fc0c43f7155f8fb9d0eda28ac0d7e7679f78&temp_url_expires=1448082214 the HTTP path should be quoted, if not bash splits out all the url after the character & Silly mistake, I've lost hours solving this. Thanks! – ------------------------------------------------- José Antonio Lorenzo Fernández email: joanlofe@gmail.com -------------------------------------------------

          People

          • Assignee:
            meth Kalman Meth
            Reporter:
            fw.ext.user FW External User
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: