Merge "Fix inline tempurl/formpost signature examples"
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
r"""
|
||||
FormPost Middleware
|
||||
|
||||
Translates a browser form post into a regular Swift object PUT.
|
||||
@@ -86,7 +86,7 @@ sample code for computing the signature::
|
||||
max_file_count = 10
|
||||
expires = int(time() + 600)
|
||||
key = 'mykey'
|
||||
hmac_body = '%s\\n%s\\n%s\\n%s\\n%s' % (path, redirect,
|
||||
hmac_body = '%s\n%s\n%s\n%s\n%s' % (path, redirect,
|
||||
max_file_size, max_file_count, expires)
|
||||
signature = hmac.new(key, hmac_body, sha1).hexdigest()
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""
|
||||
r"""
|
||||
TempURL Middleware
|
||||
|
||||
Allows the creation of URLs to provide temporary access to objects.
|
||||
@@ -69,7 +69,7 @@ seconds on ``/v1/AUTH_account/container/object``::
|
||||
expires = int(time() + 60)
|
||||
path = '/v1/AUTH_account/container/object'
|
||||
key = 'mykey'
|
||||
hmac_body = '%s\\n%s\\n%s' % (method, expires, path)
|
||||
hmac_body = '%s\n%s\n%s' % (method, expires, path)
|
||||
sig = hmac.new(key, hmac_body, sha1).hexdigest()
|
||||
|
||||
Be certain to use the full path, from the ``/v1/`` onward.
|
||||
|
||||
Reference in New Issue
Block a user