@infurnia/backend-file-storage
Advanced tools
Comparing version 2.4.0 to 2.5.0
const {Storage} = require('@google-cloud/storage'); | ||
const moment = require('moment'); | ||
class InfurniaGCSClient { | ||
@@ -102,3 +102,3 @@ constructor(project_id, key_file_path) { | ||
//get signed url | ||
get_signed_url = async(bucket_name, key, permission='read', expiry_in_secs=180) => { | ||
get_signed_url = async(bucket_name, key, permission='read', expiry_in_secs=600) => { | ||
try{ | ||
@@ -111,3 +111,5 @@ if (!bucket_name) throw new Error(`bucket_name must be specified`); | ||
const gcs_file = this.gcsClient.bucket(bucket_name).file(key); | ||
const res = await gcs_file.getSignedUrl({action: permission, expires: expiry_in_secs}); | ||
let expires = new Date(); | ||
expires = moment(expires).add(expiry_in_secs, 's').toDate(); | ||
const res = await gcs_file.getSignedUrl({action: permission, expires: expires}); | ||
return res[0]; | ||
@@ -114,0 +116,0 @@ } |
{ | ||
"name": "@infurnia/backend-file-storage", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"description": "Storage engine for google cloud storage", | ||
@@ -25,2 +25,3 @@ "main": "index.js", | ||
"fs": "0.0.1-security", | ||
"moment": "^2.29.4", | ||
"path": "^0.12.7" | ||
@@ -27,0 +28,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14620
329
5
+ Addedmoment@^2.29.4
+ Addedmoment@2.30.1(transitive)