On Tue, 26 Jul 2016 12:08:46 -0400, Steven Schveighoffer wrote:
I'm going off of stackoverflow's recommendations:
http://stackoverflow.com/questions/319530/restful-authentication"To be honest, a session managed on the Server is not truly Stateless."
Nobody said you had to store the session on the server ;). It can be stored in a cookie.
But in any case, my understanding is that vibe's registerRestInterface
does not provide easy ways to get at the HTTP session data. I'm new to
vibe, so maybe I can do it in a better way.But I want to try and stay true to the definition. If it's almost REST,
but not quite, then I'll just use the web interface. It seems to be the
most usable. I don't want to fight the goals of vibe.d's REST system.
Yes. registerWebInterface
seems to behave very similar to registerRestInterface
and follows the REST pattern. This was all a reply to that sessions can't be RESTful. Or were you referring to that you can't use registerRestInterface
and access sessions in vibe.d?
http://railscasts.com/episodes/270-authentication-in-rails-3-1?view=asciicast
Not too interested in RoR stuff, but thanks.
Well, I just want to show that indeed sessions can be RESTful. I could have avoiding giving an example, but I though it would be more useful with an example.
Ugh. I want as much introspection as possible :P
What I've done as a workaround is to rearrange my routes. Instead of
getWidget, I use the route widget/op, where op is the name of the
operation. It reads better to me, and is funky enough that it doesn't
have cringeworthy grammar in English :) If I need to leave the prefix, I
can just rename the path.I'll get used to it I suppose...
You do have a couple of options now. If none of them fits your need then the question is if you really should be using registerWebInterface
.
Note, I'm not against adding an option to "leave the prefix". I'm just trying to help to come up with alternatives.
/Jacob Carlborg