TrustTheVote-Project / ABC-backend

https://abc-backend.vercel.app
Other
4 stars 6 forks source link

Change Log

Version 3.3.1

Version 3.3.0

Version 3.1.2

Version 3.0.1

Version 1.4.0

Version 1.3.0

Version 1.2.1

Build Environment

export AWS_PROFILE=abcbackenddeploy

aws s3 mb s3://abc-backend-deploy-development

sam validate

sam build

sam package --output-template-file packaged.yaml --s3-bucket abc-backend-deploy-development

sam deploy --template-file packaged.yaml --capabilities CAPABILITY_IAM --stack-name ABCBackendDevelopment2 --parameter-overrides environment=development

Versioned deploy

aws s3 mb s3://abc-backend-deploy-development-v{majorVersion}-{minorVersion}-{patch}

sam validate sam build sam package --output-template-file packaged.yaml --s3-bucket abc-backend-deploy-development-v{majorVersion}-{minorVersion}-{patch} sam deploy --template-file packaged.yaml --capabilities CAPABILITY_IAM --stack-name ABCBackendDevelopment2-v{majorVersion}-{minorVersion}-{patch} --parameter-overrides environment=development-v{majorVersion}-{minorVersion}-{patch}

non-persistant dynamodb

docker run -p 8000:8000 amazon/dynamodb-local

Seeding data:

sh db-init.sh

Definitions and data in db-json/

aws dynamodb scan --table-name abc_voters_local --endpoint-url http://localhost:8000

http://localhost:8000

Persistant dynamodb data population

Seeding data:

sh dev-db-init.sh

S3 bucket document population

aws s3 sync ./docs s3://abc-documents-development

aws s3 sync ./docs s3://abc-documents-development-v{majorVersion}-{minorVersion}-{patch}

API

localhost

sam local start-api --env-vars local-env-windows.json sam local start-api --env-vars local-env-osx.json sam local start-api --env-vars local-env-linux.json

sam build AuthorizationFunction && \ sam local invoke "AuthorizationFunction" -e test-events/api-request-for-login.json

curl http://127.0.0.1:3000/getCurrentElection

curl -H "Content-Type: application/json" --request POST --data '{"IDnumber":"emptyresponse", "firstName":"Rowan", "lastName": "Quinn", "dateOfBirth":"2000-04-01"}' http://localhost:3000/lookupVoterByIDnumber

curl --header "Content-Type: application/json" --request POST --data '{"IDnumber":"12-34-56-79", "firstName":"Rowan", "lastName": "Quinn", "dateOfBirth":"2000-04-01"}' http://localhost:3000/lookupVoterByIDnumber

curl --header "Content-Type: application/json" --request POST --data '{"IDnumber":"C46253", "firstName":"Blake", "lastName": "Emerson", "dateOfBirth":"2000-04-01"}' http://localhost:3000/lookupVoterByIDnumber

API Gateway

V3.3.1 Dev URLs

Base URL: https://hrg7kjw4c3.execute-api.us-east-1.amazonaws.com/development-v3-3-1

V3.3.0 Dev URLs:

Base URL: https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/

Previous version V3.01:

Base URL: https:// tvghm1ioy6.execute-api.us-east-1.amazonaws.com/development-v3-0-1/

//getCurrentElection curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/getCurrentElection

//getConfigurations curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/getConfigurations

//getElectionDefinition curl -H "Cache-Control: no-cache" -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request GET https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/getElectionDefinition

//getAffidavitTemplate curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/getAffidavitTemplate

//Easter eggs

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"IDnumber":"emptyresponse", "firstName":"Rowan", "lastName": "Quinn", "yearOfBirth":"2000"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/lookupVoterByIDnumber curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"IDnumber":"wrongresponse", "firstName":"Rowan", "lastName": "Quinn", "yearOfBirth":"2000"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/lookupVoterByIDnumber curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"IDnumber":"noresponse", "firstName":"Rowan", "lastName": "Quinn", "yearOfBirth":"2000"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/lookupVoterByIDnumber

// DLN lookup

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"IDnumberHashTruncated":"1F15CC9BB9E521DE14600E02E001F375", "firstName":"Qiu", "lastName": "Xun", "yearOfBirth":"2000"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/lookupVoterByIDnumber

// State ID lookup

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"IDnumberHashTruncated":"16333B5622E9528036778FED1165B199", "firstName":"Rowan", "lastName": "Quinn", "yearOfBirth":"2000"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/lookupVoterByIDnumber

// SSN4 lookup

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"SSN4HashTruncated":"95439DD70D46C990F352206BFC1E0CA7", "firstName":"Rowan", "lastName": "Quinn", "yearOfBirth":"2000"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/lookupVoterBySSN4

// Address lookup

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"firstName": "Rowan","lastName": "Quinn","yearOfBirth": "2000","streetNumber": "3","ZIP5": "77707"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/lookupVoterByAddress

// Post Begin

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"VIDN":"P01234567890"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/postBegin

// Post Incomplete

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"VIDN":"P01234567890"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/postIncomplete

// Post Complete

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"VIDN":"P01234567890"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/postComplete

//Get Incremented Incomplete count/timestamp

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"SSN4":"1236", "firstName":"Rowan", "lastName": "Quinn", "yearOfBirth":"2000"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/lookupVoterBySSN4

//Blank Ballot

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"VIDN":"P01234567890"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/getBlankBallot

//Lookup Voter Email

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"VIDN":"A00000000006"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/lookupVoterEmail

curl -H "Authorization: Bearer [Appropriate API KEY HERE]" -H "Content-Type: application/json" --request POST --data '{"IDnumber":"noresponse", "firstName":"Rowan", "lastName": "Quinn", "yearOfBirth":"2000"}' https://3u9zs7ro0h.execute-api.us-east-1.amazonaws.com/development-v3-3-0/lookupVoterByIDnumber