-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
customClaims provide option for default value #610
Comments
This makes total sense to me, is this something you may be able to contribute? |
Sure, can you point me which files I should explore |
Unfortunately because not all endpoints are migrated from node to go we have to fix this in two places so while the change is probably not too hard (famous last words), it probably requires a lot of changes. For node, the magic happens here: https://github.com/nhost/hasura-auth/blob/main/src/utils/jwt/custom-claims.ts#L91 For gi it is this file: https://github.com/nhost/hasura-auth/blob/main/go/controller/custom_claims.go I think the first thing we need to consider is how to configure this. My main concern is that the way that the env var For isntance:
|
any feedback on using What is the type jsonPath struct {
path string
jpath *jsonpath.JSONPath
defaultValue *any
} |
that's probably a fine place. Regarding type, I think any is better in case there is need to support other types (no need for a pointer as any can be a pointer already) |
please review go implementation #614 |
updated TS files to support default for Custom Claims |
I am using customClaims where for some cases this session variable might be null.
when I have permissions setup with
{"org_id":{"_eq":"x-hasura-default-org"}}
, when x-hasura-default-org is null, I will getinvalid input syntax for type uuid: \"null\"
errorAsk
as suggested in this hasura issue, provide option to set default value for
customClaims
e.g.hasura/graphql-engine#5134
The text was updated successfully, but these errors were encountered: