usdigitalresponse / cpf-reporter

CPF Reporter application maintained by the USDR Grants program.
Apache License 2.0
0 stars 4 forks source link

Agency Report Submission - Fix python validation errors #184

Open as1729 opened 7 months ago

as1729 commented 7 months ago

Current State

https://app.datadoghq.com/logs?query=service%3Acpf-reporter&cols=host%2Cservice&event=AgAAAY7QPS9ehYs9OQAAAAAAAAAYAAAAAEFZN1FRcmJoQUFEdlRqSDJuZlg1TmdBQgAAACQAAAAAMDE4ZWQwNzYtNTIxOC00MTNlLWE1YmEtZWFkOGRmZjIxM2Nk&fromUser=true&index=%2A&messageDisplay=inline&refresh_mode=sliding&storage=hot&stream_sort=desc&viz=stream&from_ts=1712847823199&to_ts=1712934223199&live=true

Expected State

The Error does not show up and the lambda executes successfully

Acceptance Criteria

  1. Put an object in S3
    awslocal s3api put-object \
    --bucket cpf-reporter \
    --key test/upload.xlsm \
    --body ....
  2. Invoke the lambda function via awslocal
    awslocal lambda invoke --function-name localstack-lambda-url-example \
    --cli-binary-format raw-in-base64-out \
    --payload "{\"Records\":[{\"eventVersion\":\"2.0\",\"eventSource\":\"aws:s3\",\"awsRegion\":\"us-east-1\",\"eventTime\":\"1970-01-01T00:00:00.000Z\",\"eventName\":\"ObjectCreated:Put\",\"userIdentity\":{\"principalId\":\"EXAMPLE\"},\"requestParameters\":{\"sourceIPAddress\":\"127.0.0.1\"},\"responseElements\":{\"x-amz-request-id\":\"EXAMPLE123456789\",\"x-amz-id-2\":\"EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH\"},\"s3\":{\"s3SchemaVersion\":\"1.0\",\"configurationId\":\"testConfigRule\",\"bucket\":{\"name\":\"cpf-reporter\",\"ownerIdentity\":{\"principalId\":\"EXAMPLE\"},\"arn\":\"arn:aws:s3:::example-bucket\"},\"object\":{\"key\":\"<REPLACE_WITH_FILE_KEY>\",\"size\":1024,\"eTag\":\"0123456789abcdef0123456789abcdef\",\"sequencer\":\"0A1B2C3D4E5F678901\"}}}]}" output.txt
ClaireValdivia commented 6 months ago

4/15 convo - Aditya finished this and it seems resolved, but uncovered a new issue that Aditya will be creating that is still blocking being able to test upload validation - new issue is #190