LearnersGuild / idm

identity management service
MIT License
2 stars 24 forks source link

Make IDM self-referencing query code more readable #108

Open heyheyjp opened 8 years ago

heyheyjp commented 8 years ago

I might very well understand this incorrectly, but it seems that the idm web service uses a refreshUserFromIDMService() middleware function from the idm-jwt-auth lib. As it happens (and as its name suggests), this function makes a graphql request (over HTTP) to...the idm service itself.

So we have a loop? If so, this should of course be avoided.

jeffreywescott commented 8 years ago

Yeah it's an odd case, for sure. And you are correct. There's no loop, though. At worst, it's just silly to do it this way, but it was primarily because I wanted to avoid a special case for IDM when it's doing the same thing with the token. We could probably refactor things so that it's not necessary, but we can still share code with idm-jwt-auth.

jeffreywescott commented 7 years ago

This is a side-effect of IDM using idm-jwt-auth. Closing.

heyheyjp commented 7 years ago

Can we please keep this open? Don't prioritize it if you don't want to, but there's something here I'd like to address if the chance ever comes up. If nothing else, the code is confusing and can be made more clear.

jeffreywescott commented 7 years ago

If we want to leave this open, I'd rather not leave it open as "service makes HTTP requests to itself". Is there a way that you can clarify which code is confusing and update the description?

heyheyjp commented 7 years ago

Done.

jeffreywescott commented 7 years ago

Thanks.