cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/4.2 to 2e25f30
Date Wed, 31 Jul 2013 23:28:11 GMT
Updated Branches:
  refs/heads/4.2 b4770f1e0 -> 2e25f3075


CLOUDSTACK-3987: Setting extract.url.expiration.interval is not honored
for S3 generated url, which is hard-coded to 1 hour.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2e25f307
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2e25f307
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2e25f307

Branch: refs/heads/4.2
Commit: 2e25f3075e478a4ab55552f442e6c34a355580c6
Parents: b4770f1
Author: Min Chen <min.chen@citrix.com>
Authored: Wed Jul 31 16:17:42 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Wed Jul 31 16:28:03 2013 -0700

----------------------------------------------------------------------
 .../storage/datastore/driver/S3ImageStoreDriverImpl.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e25f307/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
index 934e5bd..ac681cc 100644
--- a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
+++ b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
@@ -36,6 +36,7 @@ import com.cloud.agent.api.to.S3TO;
 import com.cloud.configuration.Config;
 import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.utils.NumbersUtil;
 import com.cloud.utils.S3Utils;
 
 public class S3ImageStoreDriverImpl extends  BaseImageStoreDriverImpl {
@@ -79,7 +80,11 @@ public class S3ImageStoreDriverImpl extends  BaseImageStoreDriverImpl {
         s_logger.info("Generating pre-signed s3 entity extraction URL.");
         Date expiration = new Date();
         long milliSeconds = expiration.getTime();
-        milliSeconds += 1000 * 60 * 60; // expired after one hour.
+        
+        // get extract url expiration interval set in global configuration (in seconds)
+        String urlExpirationInterval = _configDao.getValue(Config.ExtractURLExpirationInterval.toString());
+        int expirationInterval = NumbersUtil.parseInt(urlExpirationInterval, 14400);
+        milliSeconds += 1000 * expirationInterval; // expired after configured interval (in
milliseconds)
         expiration.setTime(milliSeconds);
 
         URL s3url = S3Utils.generatePresignedUrl(s3, s3.getBucketName(), key, expiration);


Mime
View raw message