How to add metadata to a request in custom middleware? #1997
Answered
by
danthegoodman1
danthegoodman1
asked this question in
Q&A
-
I have middleware that validates an API key, and checks to make sure that key has the correct permission. I'd like to attach this API key struct to the request so I can pass on some of its properties to the route handlers. Is there an elegant way to do this in Echo? My current solution is to encode my API Key data back into the header (replacing the key) and letting it continue. |
Beta Was this translation helpful? Give feedback.
Answered by
danthegoodman1
Sep 26, 2021
Replies: 1 comment
-
Ah it seems Custom Context is the way to go: https://echo.labstack.com/guide/context/ |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
danthegoodman1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah it seems Custom Context is the way to go: https://echo.labstack.com/guide/context/