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
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
"""
|
r"""
|
||||||
FormPost Middleware
|
FormPost Middleware
|
||||||
|
|
||||||
Translates a browser form post into a regular Swift object PUT.
|
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
|
max_file_count = 10
|
||||||
expires = int(time() + 600)
|
expires = int(time() + 600)
|
||||||
key = 'mykey'
|
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)
|
max_file_size, max_file_count, expires)
|
||||||
signature = hmac.new(key, hmac_body, sha1).hexdigest()
|
signature = hmac.new(key, hmac_body, sha1).hexdigest()
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
"""
|
r"""
|
||||||
TempURL Middleware
|
TempURL Middleware
|
||||||
|
|
||||||
Allows the creation of URLs to provide temporary access to objects.
|
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)
|
expires = int(time() + 60)
|
||||||
path = '/v1/AUTH_account/container/object'
|
path = '/v1/AUTH_account/container/object'
|
||||||
key = 'mykey'
|
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()
|
sig = hmac.new(key, hmac_body, sha1).hexdigest()
|
||||||
|
|
||||||
Be certain to use the full path, from the ``/v1/`` onward.
|
Be certain to use the full path, from the ``/v1/`` onward.
|
||||||
|
|||||||
Reference in New Issue
Block a user