Apply policy to pre-authenticated user

Well, yes and no. Please forget about the jwt. What i really want is to apply rate limits to a user identified by a set header value (not the JWT! But a header value that was extracted from the JWT by the Apache server, like the sub-claim for example). The header value will always be the same for a user.

You may be right about just using the JWT middleware for simplicity. But it is still good to know about how to use a custom pre-plugin together with the auth-key middleware to satisfy the use-case stated in the previous paragraph, just in case if my requirements may change.