Closed ly-tc closed 3 months ago
Getting invalid security policy path error from storeURL
storeURL should work correctly
storeURL returning security policy path error
const crypto = require('crypto'); const { Filestack } = require('filestack-js'); (async () => { const apiKey = 'your-api-key'; const apiSecret = 'your-api-secret'; const policy = Buffer.from( JSON.stringify({ call: ['store'], expiry: Math.floor(Date.now() / 1000) + 60 * 60 * 24 * 2, }) ) .toString('base64') .replace(/[+\-/]/g, '_'); const hmac = crypto.createHmac('sha256', apiSecret); hmac.write(policy); hmac.end(); const signature = Buffer.from(hmac.read()).toString('hex'); const client = Filestack(apiKey, { security: { policy, signature, }, }); const response = await client.storeURL('https://images.unsplash.com/photo-1710667069063-55d8afe19014'); // response.data = { error: 'invalid security policy path' } console.log(response); })();
The issue has been resolved by Filestack engineering team. Closing this!
Getting invalid security policy path error from storeURL
Expected Behavior
storeURL should work correctly
Current Behavior
storeURL returning security policy path error
Steps to Reproduce (for bugs)
Your Environment