Skip to content
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

json array session variables in auth hook give parse error #10107

Open
mostafashr opened this issue Jan 20, 2024 · 1 comment
Open

json array session variables in auth hook give parse error #10107

mostafashr opened this issue Jan 20, 2024 · 1 comment
Labels
k/bug Something isn't working t/gql-services

Comments

@mostafashr
Copy link

mostafashr commented Jan 20, 2024

Version Information

Server Version: v2.36.1
CLI Version (for CLI related issue):

Environment

OSS

What is the current behaviour?

in our system we use auth hook to authenticate and authorize users the auth hook give a response like so:

{
"X-Hasura-role":"user",
"X-Hasura-User-Id":"d6630142-d77c-4241-b5c3-ff28374114d0",
"X-Hasura-Allowed-Ids":[
"test1",
"test2"
]
}

which means user has access to test1 and test2 group

What is the expected behaviour?

when i do this hasura give this error
"event":{"detail":"Invalid response from authorization hook: Error in $['X-Hasura-Allowed-Ids']: parsing Text failed, expected String, but encountered Array","type":"conn_err"},"user_vars":null}

if i switch from list to {"test1","test2"} notation it will solve the issue but it is not a supported type in any language. i see a merge request 2475 and 1799 which state it is fixed and merged but it is not working correctly for me. is there any solution?

@mostafashr mostafashr added the k/bug Something isn't working label Jan 20, 2024
@mostafashr mostafashr changed the title array session variables in auth hook give parse error json array session variables in auth hook give parse error Jan 20, 2024
@codingkarthik
Copy link
Contributor

@mostafashr Unfortunately, we don't support array session variables yet. The #1799 PR added support to accept {"test1", "test2"} (String) as an array value. Please add a 👍🏽 to the issue if you'd like us to get this issue prioritized by our product team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/bug Something isn't working t/gql-services
Projects
None yet
Development

No branches or pull requests

3 participants