Comment 3 for bug 1607519

Revision history for this message
Donagh McCabe (donagh-mccabe) wrote :

This is an invalid usage of swift-temp-url:

    swift-temp-url GET 30 https://blah/v1/AUTH_account/c/o secret

The third argument is https://blah/v1/AUTH_account/c/o. That is not a valid path -- it's a full URL. The correct value should be /v1/AUTH_account/c/o. So the correct usage should have been:

    swift-temp-url GET 30 /v1/AUTH_account/c/o secret

The user is expected to create a full URL by adding the schema and netloc. The help text shows one way to do this. Note: that help text was patched very recently to add double-quotes around the path so that he "&" in the query parameters is not interpreted by your shell.

The purpose of the "WARNING: Non-object paths will be rejected by tempurl." message is to remind the user that tempurl only works on objects, so if the path does not include an object name, don't be surprised that the result won't work. I've found this reminder helpful - I'm not sure why it prints the signature and not simply exit after printing the warning.

> in below case, container and object does not exist. still it generates a valid URI.
The purpose of the tool is to generate signatures for a given path -- it does not attempt to confirm that the object actually exists.

Working with tempurl can be frustrating -- it's easy to make a mistake. For the above example, a usefull enhancement for the tool would be to recognise that a full URL (including scehema/netloc) was provided and to remove them from the result (or remove them from the signature generation, but add them back to the end result).

Another useful feature would be someway to indicate that the time is an absolute time --- this would make swift-temp-url useful as a validation tool for home-grown signature-generating code. An easy way would be examine the time value -- anything less than the current time could be considered to be elapsed seconds, anything larger can be assumed to be an absolute time.

Note: similar problems may exist in bin/swift