A reference set of API endpoints to support the "Generate QR code" feature from the OA Wallet Apps (Android, iOS)
getuploadurl
generates a temporary S3 presigned upload url for the OA Wallet App to upload the chosen document that the user wishes to generate a QR code for.
curl --location --request GET 'https://<DEPLOYED_ENDPOINT>/dev/getuploadurl'
{
"filename": "<ASSIGNED_FILENAME>",
"upload_url": "<PRESIGNED_UPLOAD_URL>"
}
getdownloadurl
generates a temporary S3 presigned download url for the OA Wallet App to encode into a QR code.
curl --location --request POST 'https://<DEPLOYED_ENDPOINT>/dev/getdownloadurl' \
--header 'Content-Type: application/json' \
--data-raw '{
"filename" : "<ASSIGNED_FILENAME>",
"expiry_in_seconds" : <INTEGER>
}'
{
"download_url": "<PRESIGNED_DOWNLOAD_URL>"
}
- Open
config.ts
and add in the S3 bucket name to be provisioned.
This project has been generated using the aws-nodejs-typescript
template from the Serverless framework.
For detailed instructions, please refer to the documentation.
Depending on your preferred package manager, follow the instructions below to deploy your project.
Requirements: NodeJS
lts/fermium (v.14.15.0)
. If you're using nvm, runnvm use
to ensure you're using the same Node version in local and in your lambda's runtime.
- Run
npm i
to install the project dependencies - Run
npx sls deploy
to deploy this stack to AWS
- Run
yarn
to install the project dependencies - Run
yarn sls deploy
to deploy this stack to AWS
⚠️ As is, this template, once deployed, opens a public endpoint within your AWS account resources. Anybody with the URL can actively execute the API Gateway endpoint and the corresponding lambda. You should protect this endpoint with the authentication method of your choice.
Upon succesful deployment, copy the deployed endpoints into the the respective config files for OA Wallet (Android/iOS)