Documentation #15258
closedTemp URL Operations Documentation
0%
Description
Red Hat customer reported that the following URL contains sample code at the bottom of the page that does not work.
Updated by Benjamin Schmaus about 8 years ago
Customer was using 1.3.2 RGW w/ Civetweb.
Updated by Diwakar Goel about 8 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
Updated by Diwakar Goel about 8 years ago
Updated by Nathan Cutler about 8 years ago
- Status changed from New to In Progress
Updated by Zac Dover over 4 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 zac.dover@gmail.com.