API infrastructure to interact with AWS services (e.g DynamoDB and Cognito).
Package requirements are specified in the src_src[:exports code]{requirements.txt}. You will also need to create a .env configuration file with the necessary AWS access keys/information.
--- /.env --- COGNITO_CLIENT_ID=XXXXX AWS_ACCESS_KEY_ID=XXXXX AWS_SECRET_ACCESS_KEY=XXXX
These parameters are supplied fed into the script at startup by Flask’s dotenv implementation.
This API has auth capabilities to register/login users, such that an access key can be obtained to either make a request to DynamoDB or to make an authenticated request to the DynamoDB functions of this API. The endpoints have been segregated below into Cognito and DynamoDB functions.
Self-explanatory.
- Endpoint: src_src[:exports code]{/signup}.
- Methods: POST
- Argument format: Send username/password in Auth header.
- Other notes: username must be an email. Password must have 8 chars minimum, >=1 uppercase letter, >=1 number, >=1 special symbol. A character can be consecutively repeated a maximum of 2 times.