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

API Lambda to generate pre-signed URLs for uploading files #28

Merged
merged 6 commits into from
Dec 5, 2024

Conversation

briri
Copy link
Collaborator

@briri briri commented Dec 4, 2024

New API function to support the generate of pre-signed URLs that COKI can use to send us match data files.

Initial part of #21.

Also fixed up some issues with the API function that pre-signs URLs to download DMP metadata files:

  • Fixed name in package.json
  • Removed unnecessary sam_build_deploy.rb script
  • Fixed typo and remove unused imports
  • Fixed broken tests

@briri briri requested a review from jupiter007 December 4, 2024 21:26
Copy link
Collaborator

@jupiter007 jupiter007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of minor comments.

LGTM

lambdas/api/get_dmps_downloads/src/__tests__/index.spec.ts Outdated Show resolved Hide resolved
lambdas/api/template.yaml Outdated Show resolved Hide resolved
@@ -0,0 +1,138 @@
const mockGetExport = jest.fn();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to run these unit tests locally? Whenever I try I get the error "Cannot find module '@aws-sdk/client-cloudformation'".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you need to be in the lambdas/api/put_dmps_uploads dir and run npm install first then npm run test that should install all of those dev dependencies.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that, but still see that error for some reason.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. try going into the lambda/layers/dmptool/cloudformation directory and run npm install. Then go back to the lambda/api/put_dmps_uploads dir and run the tests again. They reference those lambda layers directly when you run locally so I wonder if the error is actually coming from the layer

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @briri. That worked

lambdas/api/put_dmps_uploads/src/index.ts Show resolved Hide resolved
@briri briri merged commit b1e4007 into main Dec 5, 2024
@briri briri deleted the feature/BR-coki-upload branch December 5, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants