views:

610

answers:

2

I'm currently using a modified HTTP::Daemon::Threaded server in combination with SOAP::WSDL and Pod::WSDL to provide web services used by a variety of client types and roles.

---- that's not the question, the following is -----

I'd like to arrive at an optimal solution (as far as is possible) with respect to the following topics:

  • Request/Dispatch/Response speed
  • Protocol security (proper use of client-authenticated SSLv3/TLS)
  • Resource security (security roles/traits on per-resource & per-method bases)
  • Declarative specification of types, method signatures, and required security roles & traits.

Questions:

  1. I'd like to be using an IO::Select or IO::Async::Loop::IO_Ppoll -based server, but I understand that this is not compatible with in-server client authenticated SSL. Is my understanding correct?

  2. I'd like to move away from verifying the client certificate on each request, to something like CA SiteMinder, where I give out a time-limited session cookie after successful client certificate verification, which can be used on subsequent requests to avoid this time penalty (and to lessen server load). Is this going to be as secure? (or even good enough?)

  3. Is there some module/framework I can build on to provided Trait and Role -based Authorisation for the exposed object and methods. Pod::WSDL really only deals with types (and not even complex ones). I'd like to use/implement some declarative annotation (or external YAML) -based scheme to handle complex WSDL typing as well as Trait & Role Authorisation. Has anyone done this? (even separately?) Are there any other modules which might be a good starting point?

  4. Finally - Am I just crazy for doing this in Perl5 ? ;)

A: 

You're crazy for doing this in Perl :-)

Seriously though, more power to you. My question is, presuming you have some reason to reinvent this wheel, is why not consider Python? Perl is alive and well but so much of this kind of thing (low level scripting) is being done in Python now.

Finally, presuming you don't have an actual reason to be doing this (aside from fun), you should really consider a Web Framework (Django of course) and something like nginx to handle the HTTP interaction.

Adam Nelson
This is not for fun.This an attempt to modernise an existing infrastructure while re-using thousands previously written Perl modules.In any case, does Django automatically give me the kind of Authorisation infrastructure that I asked about?I do use NginX for static HTTP content. I've found that the (threaded) pure-perl server is just as fast, and a lot more flexible. The nearest alternative is NginX + FastCGI with a threaded dispatcher... which is really the same thing at the end of the day, except that now I have to deal with an external system to do client cert verification.
David Toso
After looking at the Django docs - perhaps I'm missing something - I can't see where any of the declarative WSDL typing and Role+Trait Authorisation is possible, let alone available.Are there contributed libraries that do this, or at least provide a place to start from? I'm not ruling out doing this part in another language (like Python), after all I could proxy the final requests to my existing server - as long as it doesn't cost too much.
David Toso
I'd consider Perl and Python to be equivalent tools in this case. Maybe Perl has an edge with CPAN, but Python isn't going to be able to do something you can't get with Perl (or even Ruby).
brian d foy
David, Django will give you access to the HTTP information for doing HTTP authentication, and then you'll have to plug it into some sort of authentication mechanism ( http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.META ). Or, you can use their built in authentiçation ( http://docs.djangoproject.com/en/dev/topics/auth/ ).Then, use FLUP as the cgi service to connect to nginx. Nginx doesn't speak wsgi so that won't be an option if you want to use nginx.
Adam Nelson
And, keep in mind that with Django, you still have the entire Python (2.6) stack for the low level stuff. Django just gives you best practices methods for doing all the common web stuff.
Adam Nelson
David - I just reread your first comment. Is there a reason you're concerned about speed so much? Is this for some super low powered embedded system or something? This is a list of possible HTTP servers to use in a Python stack (if you need customized HTTP services or something). http://wsgi.org/wsgi/Servers
Adam Nelson
David Toso
A: 

Ok, everyone's answering everything but the real questions.

I'll break this out into specific questions in separate posts, and won't make any mention at all of the server make-up - a topic which everyone in this thread seems to want to discuss, and which is completely irrelevant.

David Toso