cognito-local
cognito-local copied to clipboard
feat(api): add support for oauth2 token endpoint
Cognito supports more features than just its AWS-API calls demonstrate. This service fake simulates just those AWS APIs - except for .well-known/jwks.json.
This PR starts to add support for the token endpoint outlined here: https://docs.aws.amazon.com/cognito/latest/developerguide/token-endpoint.html
However, since we are not serving static data, we need to create a fake target, and then add this to our AWS API Router, so that we can get access to the services objects.
Please give some feedback on the "not real AWS target method" - it seemed the best way to get the shared service objects to the inner handler.
BUILD NOTES:
- I could not get the project to build with the newer aws-lamba types - I had to pin those to the lowest minor version originally allowed. Guidance on this would be helpful, I don't generally work on TS projects.
- I also could not get the docker image to build without the yarn lock being present - I assumed this was a mistake, as requiring a local yarn before being able to build the docker image with the containerized yarn seemed unnecessary - but hopefully can get some more feedback.
I've left a comment on the implementation, but otherwise I think this looks ok. I don't mind it being a bit hacky for these non-API routes, at least while there's only a couple of them. Let me know what you think.
The yarn and docker issues are odd though. There's a yarn.lock in the repo, so the docker image should (and does in GitHub Actions) build fine.
Hi, this would be really useful to have locally :) was there a reason the PR was not merged ?
We have been using a local fork, but I would like to move off that eventually. But had forgotten about this!