Would anyone consider storing a users role and opt...
# talk-kratos
l
Would anyone consider storing a users role and optional additional permissions in the metadata_public a bad idea? IMHO neither is sensitive data, and it saves the API server from having to make two separate API calls to kratos to get those information (first whoami, then identity lookup to get the admin metadata).
b
We are already doing this internally for a different project. It’s upto your business requirements actually. @loud-restaurant-89371
l
It would be really nice to have an endpoint which looks up a session by cookie and returns the admin metadata in the same call πŸ˜‰
c
I'm not sure if @loud-restaurant-89371 is sarcastic or not, but /sessions/whoami does exactly that 😏
I lied, it's the public one, returning the admin one from the public endpoint would be insanity. However, I would consider the role name to be fairly harmless to put in the public metadata 😁
l
Well yeah, what I meant is an admin endpoint which does both in one go. But I think having it in the public metadata is fine.