News for hackers. Stuff that matters.
Re:GraphQL Is a Trap? by gavinray on Friday May 06, 2022 @10:38AM (#31285658)
In Hasura, you authenticate externally -- can be custom API endpoint that signs a JWT/auth webhook, or an auth provider like Auth0, Okta, Firebase, Keycloak, etc. Doesn't matter, just have to return some claims values.

You can then use these claims values in your authorization (permissions) layer.

IE, when a user logs in, you can sign a claim with "X-Hasura-User-ID" = 1, and "X-Hasura-Org-ID" = 5, and then put rules on tables like:

  > "Role USER can SELECT rows in table 'user' WHEN X-Hasura-User-ID = user.id"

  > "Role USER can SELECT rows in table 'organization' WHEN X-Hasura-Org-Id = organization.id"
There's more depth to it than this, but this is the gist of it.
Re:GraphQL Is a Trap? by pycal on Friday May 06, 2022 @12:38PM (#31287177)
this is really powerful stuff when working with a CISO “the data itself defines who may access it”