lunasec icon indicating copy to clipboard operation
lunasec copied to clipboard

Refactor "X-Hasura-Real-User-Id" to "X-Hasura-User-Id"

Open breadchris opened this issue 3 years ago • 3 comments
trafficstars

Currently, the hasura permissions use "real-user-id" which is points to the user table, but the deprecated "user-id" points to the kratos table still. We should fully deprecate "user-id" pointing to kratos since we do not use it anymore.

breadchris avatar Sep 08 '22 16:09 breadchris

Semantic nit here but I think we should transition everything to the new header so we don't make breaking changes here. I don't think hasura has any optimization/special cases for X-Hasura-User-Id

ajvpot avatar Sep 08 '22 17:09 ajvpot

As it is, unless you know to use X-Hasura-Real-User-Id, your code will mysteriously not work if you use the value that hasura suggests for you to use "X-Hasura-User-Id". I have already made this mistake several times, and I know to use the "Real" value. I think biting the bullet and refactoring everything in one go to be consistent with what the documentation for hasura recommends using is warranted.

breadchris avatar Sep 08 '22 18:09 breadchris

I agree. We could change everything to something like X-Lunasec-User-Id to make it more explicit but that may be more trouble than it's worth.

ajvpot avatar Sep 08 '22 18:09 ajvpot