Skip to content

Added 'expiryTime' parameter in download Url api - implementation

Orsu Akhil requested to merge signed-expiry-time into master

This MR is to add a feature in Download URL api wherein the User can determine the time for which Signed URL to be active via GET query parameter in API Request. Related to the issue #37 (closed)

For GET /v2/files/{id}/downloadURL api , have added an extra query parameter 'expiryTime' whose value can be of sort '%dM' %dH' '%dD' integer followed by Time unit in Minutes,Hours, Days. If this parameter isn't put at all then default expiry Time of 7 Days would be set for the Signed URL. There'd be an additional check for capped interval time, the expiry time provided by user is checked with the capped value which is '7 Days' and if user provided value exceeds it then the capped value is set as expiry time for the issued signed url.

The corresponding changes in the Cloud provider implementations for Azure,GCP,IBM have been made for this feature. For AWS provider , the corresponding implementations for this API isn't available, hence didn't alter that.

The Integration tests for this feature have been added for the GCP version (i.e in file-test-gcp module) and verified them. At the moment File service core tests do not have coverage for this API endpoint , hence haven't added any Integration tests for core module.

Edited by Orsu Akhil

Merge request reports

Loading