I am converting an Express REST API into a Serverless app. My Express app was running a middleware function to validate an API key and secret using Basic Auth (through Passport.js). I was then looking up the user ID from the database and passing that through to the next function in middleware.
What is the best way to re-architect this in Serverless? I see the documentation on how to set up a custom authorizer function, but I don’t see anything about passing data from that (i.e. user ID) into the called function. I also see the section about setting API keys but I’m not sure if that’s what I want to use, since they are only talking about using X-Api-Key (we need to use both key and secret).
Any help is appreciated!