On 7/26/16 10:53 AM, Jacob Carlborg wrote:

On Tue, 26 Jul 2016 08:42:06 -0400, Steven Schveighoffer wrote:

I am using sessions to do authentication, so it can't be RESTful.

The resource would be "session". When creating a "session" resource you would store the data in the session. When destroying the "session" resource you would delete the data from the session. This is an example of a session controller in Rails:

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."

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.

http://railscasts.com/episodes/270-authentication-in-rails-3-1?view=asciicast

Not too interested in RoR stuff, but thanks.

One might ask, why do you care about the route names then? Well, I just
do :) I want the route URLs to look intuitive when I'm testing them in a
browser.

I think it would be nice to have an attribute that says "leave the prefix".

If you think it's easier you can manually set up the routes. There's even an example how to do that and using sessions: https://vibed.org/docs#http-sessions

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...

-Steve