[SOLVED] How to add a custom map of JWT claims to database settings
I'm submitting a ... <!-- check one with "x" -->

- [x] feature request
- 
PostGraphile version: 4.11.0

<!-- CLI: `postgraphile --version`; Library: package version -->

I am using an external oauth solution (keycloak) to produce JWT, and I am unable to specify a single claim for the role.  As such, I would like to provide a function to map the JWT claims to the role to use in the database, and other settings in the database during the transaction.

Currently there are two suggested methods to implement JWTs via an external party:
 (1) Turning off postgraphile's internal JWT verification and use of `express-jwt` as per [https://www.graphile.org/postgraphile/jwk-verification/]; and
(2) Via using the option, `jwtPublicKey`.

When using method (1) a property called, `user` can be accessed within the function, `pgSettings` that can be used to determine a role and settings based on the JWT claims.  Unfortunately, method (1) only works for HTTP requests and not for Websockets. (because Headers cannot be set for websocket requests, and the authorization header needs to be sent within a message).  As such method (1) does not work for websocket connections.

When using method (2), the function, `pgSettings` is executed before the JWT claims are extracted, and thus the claims are not accessible from within a function called `pgSettings`.

I have developed a patch, (using `patch-package`) to enable a new option, `pgSettingsForJwtClaims` that determines settings and a role to apply to the database based on the JWT claims.

[postgraphile+4.11.0.patch.gz](https://github.com/graphile/postgraphile/files/7104346/postgraphile%2B4.11.0.patch.gz)
