#214 create shared auth utility#230
Open
tsudhakar87 wants to merge 4 commits into
Open
Conversation
mehanana
approved these changes
Jun 14, 2026
mehanana
left a comment
Contributor
There was a problem hiding this comment.
This looks good to me! I ran your test steps and it seemed to work. The only thing I wasn't able to test was getting a token and the 200 path because I couldn't find a user that had credentials set up, but I was seeing 401 errors with no token and garbage token!
One small thing I noticed with the 401 was that the donors lambda returned the message "Unauthorized" while the other lambdas (users, expenditures, and reports) returned "Authentication required". I don't think this is a big issue, but wanted to highlight it just in case they should all return the same message.
nourshoreibah
left a comment
Collaborator
There was a problem hiding this comment.
This is awesome, thank you! Huge amount of tech debt gone
nourshoreibah
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ℹ️ Issue
Closes #214
📝 Description
Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.
Briefly list the changes made to the code:
shared/lambda-auth/@branch/lambda-authinstead of their own auth implementationsDockerfileto build the shared package from source before installing the lambda's dependenciesdocker-compose.ymlto use the monorepo root as the Docker build context (required to includeshared/in the build) and added missingCOGNITO_USER_POOL_ID/COGNITO_CLIENT_IDenv vars to the users and projects services.dockerignorelambda-cli.js) to auto-generate theauth.tswrapper oninit-handlershared/into this repo directly instead of pointing it at the C4C shared submodule✔️ Verification
make upcurl -X POST http://localhost:3006/auth/login -H "Content-Type: application/json" -d '{"email":"<your-email>","password":"<your-password>"}'curl http://localhost:3003/donors -H "Authorization: Bearer <token>"(returns 200 with donor data)Authorization: Bearer abc), also returns 401🏕️ (Optional) Future Work / Notes
Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!
Moved the
shareddirectory into this repo, as I don't believe this lambda-auth utility needs to be shared across all of c4c, but let me know if there's another way I should go about this or if thesharedsubmodule is needed