Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-signed download URL for attachments to webhook payload #1683

Closed
liangyuanruo opened this issue Apr 20, 2021 · 0 comments · Fixed by #1713
Closed

Add pre-signed download URL for attachments to webhook payload #1683

liangyuanruo opened this issue Apr 20, 2021 · 0 comments · Fixed by #1713
Assignees
Labels
P2 planned for next 1-2 months

Comments

@liangyuanruo
Copy link
Contributor

liangyuanruo commented Apr 20, 2021

This is part 1 of the story for webhook attachments.

  const webhookData: WebhookData = {
    formId: String(this.form),
    submissionId: String(this._id),
    encryptedContent: this.encryptedContent,
    verifiedContent: this.verifiedContent,
    version: this.version,
    created: this.created,
    attachmentDownloadUrls: metadata,  // Map(fieldId -> S3 Presigned URL)
  }

We want to add a new field attachmentDownloadUrls into the above block. This object will be a JS object mapping the form’s fieldId to an S3 pre-signed URL to allow the FormSG Webhook SDK to download the object.

The S3 pre-signed URL will be generated by a new function on each call with the AWS S3 SDK, and each URL will be valid for 1 hour from the time it is generated and sent downstream.

A separate issue in opengovsg/formsg-javascript-sdk#60 has been created for the delivery of the downloadAttachments() function in the SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 planned for next 1-2 months
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants