Project

General

Profile

Documentation #15258

Temp URL Operations Documentation

Added by Benjamin Schmaus over 6 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
documentation
Target version:
-
% Done:

0%

Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Red Hat customer reported that the following URL contains sample code at the bottom of the page that does not work.

http://docs.ceph.com/docs/master/radosgw/swift/tempurl/

History

#1 Updated by Aron Gunn over 6 years ago

  • Assignee set to Aron Gunn

#2 Updated by Benjamin Schmaus over 6 years ago

Customer was using 1.3.2 RGW w/ Civetweb.

#3 Updated by Diwakar Goel over 6 years ago

Any updates on this?
Thanks.

#4 Updated by Diwakar Goel over 6 years ago

The bug in the documentation at http://docs.ceph.com/docs/master/radosgw/swift/tempurl/ is the extra line:

hmac_body = hmac.new(key, hmac_body, sha1).hexdigest()

and how host is defined. (Note: the /swift)

The sample python script instead should be:

import hmac
from hashlib import sha1
from time import time

method = 'GET'
host = 'https://objectstore.example.com/swift'
duration_in_seconds = 300  # Duration for which the url is valid
expires = int(time() + duration_in_seconds)
path = '/v1/your-bucket/your-object'
key = 'secret'
hmac_body = '%s\n%s\n%s' % (method, expires, path)
sig = hmac.new(key, hmac_body, sha1).hexdigest()
rest_uri = "{host}{path}?temp_url_sig={sig}&temp_url_expires={expires}".format(
             host=host, path=path, sig=sig, expires=expires)
print rest_uri

# Example Output
# https://objectstore.example.com/swift/v1/your-bucket/your-object?temp_url_sig=ff4657876227fc6025f04fcf1e82818266d022c6&temp_url_expires=1423200992

#6 Updated by Nathan Cutler over 6 years ago

  • Status changed from New to In Progress

#7 Updated by Zac Dover almost 3 years ago

  • Status changed from In Progress to Closed

This bug has been judged too old to fix. This is because either it is either 1) raised against a version of Ceph prior to Luminous, or 2) just really old, and untouched for so long that it is unlikely nowadays to represent a live documentation concern.

If you think that the closing of this bug is an error, raise another bug of a similar kind. If you think that the matter requires urgent attention, please let Zac Dover know at .

Also available in: Atom PDF