From azurit at pobox.sk Sun Feb 19 15:39:44 2012 From: azurit at pobox.sk (azurIt) Date: Sun, 19 Feb 2012 15:39:44 +0100 Subject: [Soap-Python] rpclib and unicode strings Message-ID: <20120219153944.00A48F05@pobox.sk> Hi, i noticed that rpclib is not converting input strings to unicode (don't know exactly which version changes this behavior). Can i ask how can i switch it back to unicode? Do i need to set different type for input values other than 'String'? Thnx! azur From azurit at pobox.sk Sun Feb 19 15:54:30 2012 From: azurit at pobox.sk (azurIt) Date: Sun, 19 Feb 2012 15:54:30 +0100 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <20120219153944.00A48F05@pobox.sk> References: <20120219153944.00A48F05@pobox.sk> Message-ID: <20120219155430.EC6A8F0F@pobox.sk> Little more info: When i send ASCII chars, i got 'str' type but when i send unicode chars, i got 'unicode' type. What should i do to always get unicode? ______________________________________________________________ > Od: "azurIt" > Komu: > D?tum: 19.02.2012 15:41 > Predmet: [Soap-Python] rpclib and unicode strings > >Hi, > >i noticed that rpclib is not converting input strings to unicode (don't know exactly which version changes this behavior). Can i ask how can i switch it back to unicode? Do i need to set different type for input values other than 'String'? Thnx! > >azur >_______________________________________________ >Soap mailing list >Soap at python.org >http://mail.python.org/mailman/listinfo/soap > From burak.arslan at arskom.com.tr Sun Feb 19 15:57:28 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sun, 19 Feb 2012 16:57:28 +0200 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <20120219155430.EC6A8F0F@pobox.sk> References: <20120219153944.00A48F05@pobox.sk> <20120219155430.EC6A8F0F@pobox.sk> Message-ID: <4F410DD8.9060305@arskom.com.tr> On 02/19/12 16:54, azurIt wrote: > Little more info: > When i send ASCII chars, i got 'str' type but when i send unicode chars, i got 'unicode' type. What should i do to always get unicode? > hi, you need to provide me with a test case to have something to discuss on. rpclib relies on lxml for unicode conversion when dealing with xml data. turns out it's a little quirky: In [4]: a=etree.fromstring('data') In [5]: a[0].text Out[5]: 'data' In [6]: a=etree.fromstring('data?') In [7]: a[0].text Out[7]: u'data\xe7' so, doing unicode(str) in https://github.com/arskom/rpclib/blob/master/src/rpclib/model/primitive.py#L142 could safely fix your problem. is this ok with you? best, burak From azurit at pobox.sk Sun Feb 19 19:58:06 2012 From: azurit at pobox.sk (azurIt) Date: Sun, 19 Feb 2012 19:58:06 +0100 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <4F410DD8.9060305@arskom.com.tr> References: <20120219153944.00A48F05@pobox.sk>, <20120219155430.EC6A8F0F@pobox.sk> <4F410DD8.9060305@arskom.com.tr> Message-ID: <20120219195806.AB7FE942@pobox.sk> Will you fix it in rpclib or should i do it somewhere in my app? tnx azur ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 19.02.2012 15:57 > Predmet: Re: [Soap-Python] rpclib and unicode strings > > CC: soap at python.org >On 02/19/12 16:54, azurIt wrote: >> Little more info: >> When i send ASCII chars, i got 'str' type but when i send unicode chars, i got 'unicode' type. What should i do to always get unicode? >> > >hi, > >you need to provide me with a test case to have something to discuss on. > >rpclib relies on lxml for unicode conversion when dealing with xml data. >turns out it's a little quirky: > >In [4]: a=etree.fromstring('encoding="UTF-8"?>data') > >In [5]: a[0].text >Out[5]: 'data' > >In [6]: a=etree.fromstring('encoding="UTF-8"?>data?') > >In [7]: a[0].text >Out[7]: u'data\xe7' > >so, doing unicode(str) in >https://github.com/arskom/rpclib/blob/master/src/rpclib/model/primitive.py#L142 >could safely fix your problem. is this ok with you? > >best, >burak > From burak.arslan at arskom.com.tr Sun Feb 19 20:13:37 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sun, 19 Feb 2012 21:13:37 +0200 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <20120219195806.AB7FE942@pobox.sk> References: <20120219153944.00A48F05@pobox.sk>, <20120219155430.EC6A8F0F@pobox.sk> <4F410DD8.9060305@arskom.com.tr> <20120219195806.AB7FE942@pobox.sk> Message-ID: <4F4149E1.3050003@arskom.com.tr> On 02/19/12 20:58, azurIt wrote: > Will you fix it in rpclib or should i do it somewhere in my app? tnx > > azur > question: why is this a problem? lxml's behaviour is, while a tad hacky i must admit, seems mostly harmless to me. have a look in my fork and tell me if the latest patch works for you. best, burak From azurit at pobox.sk Sun Feb 19 20:36:13 2012 From: azurit at pobox.sk (azurIt) Date: Sun, 19 Feb 2012 20:36:13 +0100 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <4F4149E1.3050003@arskom.com.tr> References: <20120219153944.00A48F05@pobox.sk>, <20120219155430.EC6A8F0F@pobox.sk>, <4F410DD8.9060305@arskom.com.tr>, <20120219195806.AB7FE942@pobox.sk> <4F4149E1.3050003@arskom.com.tr> Message-ID: <20120219203613.43A79341@pobox.sk> Looks fine so now i have to replace all 'String' types with 'Unicode'? azur ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 19.02.2012 20:13 > Predmet: Re: [Soap-Python] rpclib and unicode strings > > CC: soap at python.org >On 02/19/12 20:58, azurIt wrote: >> Will you fix it in rpclib or should i do it somewhere in my app? tnx >> >> azur >> > >question: why is this a problem? lxml's behaviour is, while a tad hacky >i must admit, seems mostly harmless to me. > >have a look in my fork and tell me if the latest patch works for you. > >best, >burak > > > From burak.arslan at arskom.com.tr Sun Feb 19 20:41:43 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sun, 19 Feb 2012 21:41:43 +0200 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <20120219203613.43A79341@pobox.sk> References: <20120219153944.00A48F05@pobox.sk>, <20120219155430.EC6A8F0F@pobox.sk>, <4F410DD8.9060305@arskom.com.tr>, <20120219195806.AB7FE942@pobox.sk> <4F4149E1.3050003@arskom.com.tr> <20120219203613.43A79341@pobox.sk> Message-ID: <4F415077.4030701@arskom.com.tr> On 02/19/12 21:36, azurIt wrote: > Looks fine so now i have to replace all 'String' types with 'Unicode'? > > azur with the current state of things, yeah. I could however switch back to old way, where String = Unicode and real string is hidden as _String. what do you think? is it a huge backwards compatibility break ? or a minor one? > > ______________________________________________________________ >> Od: "Burak Arslan" >> Komu: azurIt >> D?tum: 19.02.2012 20:13 >> Predmet: Re: [Soap-Python] rpclib and unicode strings >> >> CC: soap at python.org >> On 02/19/12 20:58, azurIt wrote: >>> Will you fix it in rpclib or should i do it somewhere in my app? tnx >>> >>> azur >>> >> question: why is this a problem? lxml's behaviour is, while a tad hacky >> i must admit, seems mostly harmless to me. >> >> have a look in my fork and tell me if the latest patch works for you. >> >> best, >> burak >> >> >> > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From azurit at pobox.sk Sun Feb 19 20:51:03 2012 From: azurit at pobox.sk (azurIt) Date: Sun, 19 Feb 2012 20:51:03 +0100 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <4F415077.4030701@arskom.com.tr> References: <20120219153944.00A48F05@pobox.sk>, <20120219155430.EC6A8F0F@pobox.sk>, <4F410DD8.9060305@arskom.com.tr>, <20120219195806.AB7FE942@pobox.sk>, <4F4149E1.3050003@arskom.com.tr>, <20120219203613.43A79341@pobox.sk> <4F415077.4030701@arskom.com.tr> Message-ID: <20120219205103.837652B1@pobox.sk> I think it will be much cleaner to have Unicode = unicode and String = str. rpclib is beta anyway, backward incompatibility is/shoud be expected, so keep what is commited in your fork (but add a huge notice in changelog for other users). I will fix it on my side :) thank you! azur ______________________________________________________________ > Od: "Burak Arslan" > Komu: azurIt > D?tum: 19.02.2012 20:41 > Predmet: Re: [Soap-Python] rpclib and unicode strings > > CC: soap at python.org >On 02/19/12 21:36, azurIt wrote: >> Looks fine so now i have to replace all 'String' types with 'Unicode'? >> >> azur > >with the current state of things, yeah. I could however switch back to >old way, where String = Unicode and real string is hidden as _String. > >what do you think? is it a huge backwards compatibility break ? or a >minor one? > > >> >> ______________________________________________________________ >>> Od: "Burak Arslan" >>> Komu: azurIt >>> D?tum: 19.02.2012 20:13 >>> Predmet: Re: [Soap-Python] rpclib and unicode strings >>> >>> CC: soap at python.org >>> On 02/19/12 20:58, azurIt wrote: >>>> Will you fix it in rpclib or should i do it somewhere in my app? tnx >>>> >>>> azur >>>> >>> question: why is this a problem? lxml's behaviour is, while a tad hacky >>> i must admit, seems mostly harmless to me. >>> >>> have a look in my fork and tell me if the latest patch works for you. >>> >>> best, >>> burak >>> >>> >>> >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From frank at chagford.com Mon Feb 20 07:03:17 2012 From: frank at chagford.com (Frank Millman) Date: Mon, 20 Feb 2012 08:03:17 +0200 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <20120219205103.837652B1@pobox.sk> Message-ID: <3Trvhr6vtjzQ0Q@mail.python.org> azurIt wrote: > > I think it will be much cleaner to have Unicode = unicode and > String = str. rpclib is beta anyway, backward incompatibility > is/shoud be expected, so keep what is commited in your fork > (but add a huge notice in changelog for other users). I will > fix it on my side :) thank you! > > ______________________________________________________________ > > Od: "Burak Arslan" > > Komu: azurIt > > D?tum: 19.02.2012 20:41 > > Predmet: Re: [Soap-Python] rpclib and unicode strings > > > > CC: soap at python.org > >On 02/19/12 21:36, azurIt wrote: > >> Looks fine so now i have to replace all 'String' types > with 'Unicode'? > >> > >> azur > > > >with the current state of things, yeah. I could however > switch back to > >old way, where String = Unicode and real string is hidden as _String. > > > >what do you think? is it a huge backwards compatibility break ? or a > >minor one? > > I don't follow all the implications of this thread, but I thought I should mention that in python3, unicode and str are identical. If you pass 'bytes' into etree.fromstring, you get bytes back. If you pass 'str' into etree.fromstring, you get a (unicode) string back. Here is your previous example run using python 3.2 - This one uses bytes (note the 'b' at the front of the string) - >>> a = etree.fromstring(b'da ta') >>> a[0].text 'data' >>> a = etree.fromstring(b'da ta\u00e7') >>> a[0].text 'data\\u00e7' This one uses unicode, so no 'encoding' is needed (it raises an error if you try) - >>> a = etree.fromstring('data') >>> a[0].text 'data' >>> a = etree.fromstring('data\u00e7') >>> a[0].text 'data?' >>> I don't know if this is important, but I thought I should point it out. Frank Millman From dieter at handshake.de Mon Feb 20 07:38:03 2012 From: dieter at handshake.de (Dieter Maurer) Date: Mon, 20 Feb 2012 07:38:03 +0100 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <20120219155430.EC6A8F0F@pobox.sk> References: <20120219155430.EC6A8F0F@pobox.sk> Message-ID: <20289.59979.196980.478826@localhost.localdomain> azurIt wrote at 2012-2-19 15:54 +0100: > >Little more info: >When i send ASCII chars, i got 'str' type but when i send unicode chars, i got 'unicode' type. What should i do to always get unicode? This is typical Python 2 behaviour. Python 2 sees ASCII encoded "str" and the unicode section representing ASCII as equivalent. Some modules in the Python runtime library (e.g. "xmlrpclib") try hard to convert pure ASCII unicode strings into "str", probably to make it easier to use them as attribute/method names (where unicode is rejected). -- Dieter From burak.arslan at arskom.com.tr Mon Feb 20 12:56:09 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 20 Feb 2012 13:56:09 +0200 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <3Trvhr6vtjzQ0Q@mail.python.org> References: <3Trvhr6vtjzQ0Q@mail.python.org> Message-ID: <4F4234D9.4050109@arskom.com.tr> On 20/02/12 08:03, Frank Millman wrote: > I don't follow all the implications of this thread, but I thought I should > mention that in python3, unicode and str are identical. If you pass 'bytes' > into etree.fromstring, you get bytes back. If you pass 'str' into > etree.fromstring, you get a (unicode) string back. In Python 3, I think we should have String = Unicode as that distinction becomes useless (as you point out), and there's ByteArray for binary matters anyway. Here's my train of thought; bear with me: The issue here is that Unicode type may produce a str instance when data is all ascii (because of some quirky lxml behaviour). This definitely breaks the contract, but I can't think of any negative side effects of this behaviour. And as Dieter points out, str is sometimes easier to work with. I don't want to go back to the old all-unicode behaviour just for the sake of preserving backwards compatibility (where String = Unicode also for Python 2). But we could be breaking it to have little to no benefit at all. Considering all this, my decision is to separate String and Unicode for Python 2, as; Explicit is better than implicit. If you disagree, speak now or forever hold your silence :)) Best, Burak -------------- next part -------------- An HTML attachment was scrubbed... URL: From azurit at pobox.sk Mon Feb 20 14:09:55 2012 From: azurit at pobox.sk (azurIt) Date: Mon, 20 Feb 2012 14:09:55 +0100 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <4F4234D9.4050109@arskom.com.tr> References: <3Trvhr6vtjzQ0Q@mail.python.org> <4F4234D9.4050109@arskom.com.tr> Message-ID: <20120220140955.3A15CD22@pobox.sk> >> I don't follow all the implications of this thread, but I thought I should >> mention that in python3, unicode and str are identical. If you pass 'bytes' >> into etree.fromstring, you get bytes back. If you pass 'str' into >> etree.fromstring, you get a (unicode) string back. > >In Python 3, I think we should have String = Unicode as that distinction >becomes useless (as you point out), and there's ByteArray for binary >matters anyway. > >Here's my train of thought; bear with me: > >The issue here is that Unicode type may produce a str instance when data >is all ascii (because of some quirky lxml behaviour). This definitely >breaks the contract, but I can't think of any negative side effects of >this behaviour. And as Dieter points out, str is sometimes easier to >work with. How i find this out: I'm using 'unicodedata.normalize' in one of my API function and it _requires_ that second argument is unicode and not str. While rpclib was always returning unicode i just passes it to to normalize(). This stopped to work after lxml upgrade cos suddenly there were situations in which i got str instead of unicode. The fix was, of course, very easy but i don't consider this a good behavior - one really can't except that value is 'unicode' in one situation and 'str' in anoher. It should be always 'str' or always 'unicode'. > >I don't want to go back to the old all-unicode behaviour just for the >sake of preserving backwards compatibility (where String = Unicode also >for Python 2). But we could be breaking it to have little to no benefit >at all. > >Considering all this, my decision is to separate String and Unicode for >Python 2, as; > > Explicit is better than implicit. > > >If you disagree, speak now or forever hold your silence :)) > >Best, >Burak > > > > >---------- > >_______________________________________________ >Soap mailing list >Soap at python.org >http://mail.python.org/mailman/listinfo/soap > From frank at chagford.com Tue Feb 21 07:08:52 2012 From: frank at chagford.com (Frank Millman) Date: Tue, 21 Feb 2012 08:08:52 +0200 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <4F4234D9.4050109@arskom.com.tr> Message-ID: <3TsWlq4fsqzQ84@mail.python.org> Burak Arslan wrote: > [...] > Considering all this, my decision is to separate String and > Unicode for Python 2, as; > > Explicit is better than implicit. > > If you disagree, > speak now or forever hold your silence :)) > I took the liberty of checking this on the lxml mailing list - hope you don't mind. Here are the relevant sections of the response - 1. > > With Python 2 and version 2.2.2 (I don't have 2.3.3), if you pass a unicode > > string that contains a non-ASCII character, you get a unicode string back. > > If you pass a unicode string that contains only ASCII characters, you get a > > normal string back. > > This behaviour is causing a problem to a user of rpclib. > It shouldn't normally. Apparently, the problem was that the user passed the > result into unicodedata.normalize(), which rejected Py2-str as input. > Sounds like a bug in the unicodedata module to me, since str is supposed to > auto-decode into Unicode automatically on Py2. The response also had a link to a more detailed discussion, which explained that lxml does it that way to maintain compatibility with ElementTree. 2. > > so the proposal is that rpclib should always convert the string to unicode > > before returning it. > It's perfectly ok, they can just wrap it in unicode() when running in Py2, > or concatenate it with the empty unicode string. All that will change is > the type of the object (well, and its memory consumption and the time it > takes to build it, but I don't think that matters here). 3. > > With Python 3 and version 2.3.3, if you pass a unicode string to > > etree.fromstring(...), and then retrieve a text node from the tree, you get > > a unicode string back. If you pass in a byte array, you get a byte array > > back. > No, you always get a Unicode string for names and text in Python 3, > regardless of what you used for parsing (or tree building in general). I checked, and this is correct, so what I posted earlier was wrong. Sorry for the misinformation. Frank Millman From dieter at handshake.de Tue Feb 21 18:30:44 2012 From: dieter at handshake.de (Dieter Maurer) Date: Tue, 21 Feb 2012 18:30:44 +0100 Subject: [Soap-Python] rpclib and unicode strings In-Reply-To: <20120220140955.3A15CD22@pobox.sk> References: <20120220140955.3A15CD22@pobox.sk> Message-ID: <20291.54468.827541.991887@localhost.localdomain> azurIt wrote at 2012-2-20 14:09 +0100: > ... >How i find this out: >I'm using 'unicodedata.normalize' in one of my API function and it _requires_ that second argument is unicode and not str. While rpclib was always returning unicode i just passes it to to normalize(). This stopped to work after lxml upgrade cos suddenly there were situations in which i got str instead of unicode. The fix was, of course, very easy but i don't consider this a good behavior - one really can't except that value is 'unicode' in one situation and 'str' in anoher. It should be always 'str' or always 'unicode'. What you see is the effect of wishing to be nondisruptive with the Python past. Unlike Java, Python is quite an old language and it did not anticipate that in its future the world would adopt the "text is unicode" paradigm. Thus, it worked with encoded strings ("str") to represent text. We, and the Python developpers, now know that this is nowadays a handicap -- and that's the primary reason for Python 3, the backward incompatible new branch for Python development. In Python 2, one wanted to support a transition towards the modern paradigm but avoid as much disruption as possible. This has caused complex implementations (such as "return str for ascii only XML text") that often work but sometimes can have surprising effects. While Python usually treats unicode and "defaultencoding" encoded str as equivalent, there a some important exceptions: * the C interface supports either "str" or "unicode" but usually not both. I expect that this applies to "unicodedata.normalize". * hash codes for "str" and "unicode" differ (at least outside the ASCII code page). Therefore mixing "str" and "unicode" keys for dictionaries can give surprising results. -- Dieter From yasorrat at gmail.com Sat Feb 25 07:24:37 2012 From: yasorrat at gmail.com (=?KOI8-R?B?5sXEz9Ig89TF0MHOz9c=?=) Date: Sat, 25 Feb 2012 09:24:37 +0300 Subject: [Soap-Python] rpclib and XmlAttribute Message-ID: Hello, how can I use class XmlAttribute properly? For example, in "helloworld_soap.py" example how receive data in attributes instead of elements? class HelloWorldService(ServiceBase): @srpc(String, Integer, _returns=Iterable(String)) def say_hello(name, times): ''' Docstrings for service methods appear as documentation in the wsdl what fun @param name the name to say hello to @param the number of times to say hello @return the completed array ''' for i in range(times): yield 'Hello, %s' % name @srpc(XmlAttribute(String), XmlAttribute(Integer), _returns=Iterable(String)) instead of @srpc(String, Integer, _returns=Iterable(String)) I'm sorry for my english. From burak.arslan at arskom.com.tr Sat Feb 25 13:48:36 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Sat, 25 Feb 2012 14:48:36 +0200 Subject: [Soap-Python] rpclib and XmlAttribute In-Reply-To: References: Message-ID: <4F48D8A4.4090203@arskom.com.tr> Hi ?????. I guess :) Turns out XmlAttribute wasn't working properly at all. This commit fixes all issues i could find: https://github.com/plq/rpclib/commit/657ea2d0ab2937017e3741a239e0426957a44ac1 Let me know how it goes. Best, Burak On 02/25/12 08:24, ????? ???????? wrote: > Hello, > how can I use class XmlAttribute properly? > For example, in "helloworld_soap.py" example how receive data in > attributes instead of elements? > > class HelloWorldService(ServiceBase): > @srpc(String, Integer, _returns=Iterable(String)) > def say_hello(name, times): > ''' > Docstrings for service methods appear as documentation in the wsdl > what fun > @param name the name to say hello to > @param the number of times to say hello > @return the completed array > ''' > for i in range(times): > yield 'Hello, %s' % name > > @srpc(XmlAttribute(String), XmlAttribute(Integer), _returns=Iterable(String)) > instead of > @srpc(String, Integer, _returns=Iterable(String)) > > I'm sorry for my english. > _______________________________________________ > Soap mailing list > Soap at python.org > http://mail.python.org/mailman/listinfo/soap From bj.cardon at gmail.com Mon Feb 27 06:09:53 2012 From: bj.cardon at gmail.com (Benjamin Cardon) Date: Sun, 26 Feb 2012 22:09:53 -0700 Subject: [Soap-Python] rpclib + Django + Mono/.NET 2.0 Web Services Message-ID: Guys, I'm trying to get these three working together well and I'm trying to use SOAP (mostly for .NET convenience). I finally got rpclib and Django working well together, but the SOAP integration with MonoDevelop is not great. First, to get Django and rpclib working together, I had to add this to rpclib.server.django: from __future__ import absolute_import otherwise I got the error 'no module http'. I am on Ubuntu 11.10, Python 2.7.2. Not sure why that was necessary. Second, I have a django project called rpctest with an app called core where the view is contained. Here is the code in my Django app. http://pastie.org/3469070 Third, I have a basic .NET 2.0 application in MonoDevelop with a Web Reference pointing at 127.0.0.1:8000/hello_world/service.wsdl and a .NET 2.0 web service that is hooked into it. Here is that code. I named the service reference hwmt in my code. http://pastie.org/3469090 So on to problems? First problem, I cannot use the web service as functions. The advantage to .NET SOAP is that you shouldn't have to do a bunch of object creation and stuff to pass simple types but in this case I have to build an object and define the types on it. Not very graceful I think. The bigger problem, though, is that when running the .NET webservice I get a 403 error as it tries to access http://127.0.0.1:8000/hello_world/service. Am I doing something wrong here?? Getting this working well would save me a lot of time on a project I'm working on. Otherwise I'll have to go .NET to .NET... Thanks BJ -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Mon Feb 27 07:54:39 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 27 Feb 2012 08:54:39 +0200 Subject: [Soap-Python] rpclib + Django + Mono/.NET 2.0 Web Services In-Reply-To: References: Message-ID: <4F4B28AF.3090700@arskom.com.tr> On 02/27/12 07:09, Benjamin Cardon wrote: > First, to get Django and rpclib working together, I had to add this to > rpclib.server.django: > > from __future__ import absolute_import > > otherwise I got the error 'no module http'. I am on Ubuntu 11.10, > Python 2.7.2. Not sure why that was necessary. > Hi there, That's python trying to import from rpclib.server.django module instead of the root django package. http://www.python.org/dev/peps/pep-0328/ the from __future__ import absolute_import hack doest not exist in python 2.4. I wonder if I should just rename the django module to django_ and be done with it. > Second, I have a django project called rpctest with an app called core > where the view is contained. Here is the code in my Django app. > > http://pastie.org/3469070 > That's exactly how it's supposed to work. Is it possible for you to put the full django project inside examples/django directory and issue a pull request? (make sure to add BSD or MIT license headers to avoid any confusion) > Third, I have a basic .NET 2.0 application in MonoDevelop with a Web > Reference pointing at 127.0.0.1:8000/hello_world/service.wsdl > and a .NET 2.0 web > service that is hooked into it. Here is that code. I named the service > reference hwmt in my code. > > http://pastie.org/3469090 > > So on to problems? > > First problem, I cannot use the web service as functions. The > advantage to .NET SOAP is that you shouldn't have to do a bunch of > object creation and stuff to pass simple types but in this case I have > to build an object and define the types on it. Not very graceful I think. > > The bigger problem, though, is that when running the .NET webservice I > get a 403 error as it tries to access > http://127.0.0.1:8000/hello_world/service. > The canonical way to get an rpclib-generated wsdl is: http://127.0.0.1:8000/hello_world/?wsdl but 127.0.0.1:8000/hello_world/.wsdl should work as well. You should try to make a http POST request to just http://127.0.0.1:8000/hello_world/ Rpclib is tested to be WS-I compliant, so I don't think there should be any problems with .NET code calling rpclib code. However, AFAIK with .NET, you need to run the WSDL document through some tool that compiles definitions in the WSDL document to C# code. Did you already do that? Does that give any errors? hth, burak From stepankk at gmail.com Mon Feb 27 14:45:56 2012 From: stepankk at gmail.com (Stepan Kornyakov) Date: Mon, 27 Feb 2012 17:45:56 +0400 Subject: [Soap-Python] rpclib + Django + Mono/.NET 2.0 Web Services In-Reply-To: <4F4B28AF.3090700@arskom.com.tr> References: <4F4B28AF.3090700@arskom.com.tr> Message-ID: > > Rpclib is tested to be WS-I compliant, so I don't think there should be > any problems with .NET code calling rpclib code. However, AFAIK with .NET, > you need to run the WSDL document through some tool that compiles > definitions in the WSDL document to C# code. Did you already do that? Does > that give any errors? Note that Mono's SOAP client has it's own WS-I compliance validator. Unfortunately, it differs from the one provided by WS-I organization. Some time ago I had a WSDL file that was compliant with both WS-I Basic Profiles 1.1 and 1.2, but Mono's WSDL utility reported several issues and failed dealing with my web service at all. For instance, I was unable to feed a WSDL file with rpc/literal binding style to it . Finally, I had to switch to document/literal wrapped binding style. 27 ??????? 2012 ?. 10:54 ???????????? Burak Arslan < burak.arslan at arskom.com.tr> ???????: > On 02/27/12 07:09, Benjamin Cardon wrote: > >> First, to get Django and rpclib working together, I had to add this to >> rpclib.server.django: >> >> from __future__ import absolute_import >> >> otherwise I got the error 'no module http'. I am on Ubuntu 11.10, Python >> 2.7.2. Not sure why that was necessary. >> >> > Hi there, > > That's python trying to import from rpclib.server.django module instead of > the root django package. > > http://www.python.org/dev/**peps/pep-0328/ > > the from __future__ import absolute_import hack doest not exist in python > 2.4. I wonder if I should just rename the django module to django_ and be > done with it. > > > > Second, I have a django project called rpctest with an app called core >> where the view is contained. Here is the code in my Django app. >> >> http://pastie.org/3469070 >> >> > That's exactly how it's supposed to work. > > Is it possible for you to put the full django project inside > examples/django directory and issue a pull request? (make sure to add BSD > or MIT license headers to avoid any confusion) > > Third, I have a basic .NET 2.0 application in MonoDevelop with a Web >> Reference pointing at 127.0.0.1:8000/hello_world/**service.wsdl< >> http://127.0.0.1:8000/hello_**world/service.wsdl> >> and a .NET 2.0 web service that is hooked into it. Here is that code. I >> named the service reference hwmt in my code. >> >> http://pastie.org/3469090 >> >> So on to problems? >> >> First problem, I cannot use the web service as functions. The advantage >> to .NET SOAP is that you shouldn't have to do a bunch of object creation >> and stuff to pass simple types but in this case I have to build an object >> and define the types on it. Not very graceful I think. >> >> The bigger problem, though, is that when running the .NET webservice I >> get a 403 error as it tries to access http://127.0.0.1:8000/hello_** >> world/service . >> >> > The canonical way to get an rpclib-generated wsdl is: > http://127.0.0.1:8000/hello_**world/?wsdlbut > 127.0.0.1:8000/hello_world/.**wsdlshould work as well. > > You should try to make a http POST request to just > http://127.0.0.1:8000/hello_**world/ > > Rpclib is tested to be WS-I compliant, so I don't think there should be > any problems with .NET code calling rpclib code. However, AFAIK with .NET, > you need to run the WSDL document through some tool that compiles > definitions in the WSDL document to C# code. Did you already do that? Does > that give any errors? > > hth, > burak > > > ______________________________**_________________ > Soap mailing list > Soap at python.org > http://mail.python.org/**mailman/listinfo/soap > -- Best regards, Stepan Kornyakov. mailto:stepankk at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From yasorrat at gmail.com Mon Feb 27 17:03:54 2012 From: yasorrat at gmail.com (=?KOI8-R?B?5sXEz9Ig89TF0MHOz9c=?=) Date: Mon, 27 Feb 2012 19:03:54 +0300 Subject: [Soap-Python] Fwd: rpclib and XmlAttribute In-Reply-To: References: <4F48D8A4.4090203@arskom.com.tr> Message-ID: Hello, Arslan! Your guess was right :) Thank you for the reply and your advice. It works :) You've helped me a lot. 25 ??????? 2012??. 16:48 ???????????? Burak Arslan ???????: > Hi ?????. I guess :) > > Turns out XmlAttribute wasn't working properly at all. This commit fixes all > issues i could find: > https://github.com/plq/rpclib/commit/657ea2d0ab2937017e3741a239e0426957a44ac1 > > Let me know how it goes. > > Best, > Burak > > > On 02/25/12 08:24, ????? ???????? wrote: >> >> Hello, >> how can I use class XmlAttribute properly? >> For example, in "helloworld_soap.py" example how receive data in >> attributes instead of elements? >> >> class HelloWorldService(ServiceBase): >> ? ? @srpc(String, Integer, _returns=Iterable(String)) >> ? ? def say_hello(name, times): >> ? ? ? ? ''' >> ? ? ? ? Docstrings for service methods appear as documentation in the wsdl >> ? ? ? ? what fun >> ? ? ? ? @param name the name to say hello to >> ? ? ? ? @param the number of times to say hello >> ? ? ? ? @return the completed array >> ? ? ? ? ''' >> ? ? ? ? for i in range(times): >> ? ? ? ? ? ? yield 'Hello, %s' % name >> >> @srpc(XmlAttribute(String), XmlAttribute(Integer), >> _returns=Iterable(String)) >> instead of >> @srpc(String, Integer, _returns=Iterable(String)) >> >> I'm sorry for my english. >> _______________________________________________ >> Soap mailing list >> Soap at python.org >> http://mail.python.org/mailman/listinfo/soap > > From bj.cardon at gmail.com Mon Feb 27 18:21:09 2012 From: bj.cardon at gmail.com (Benjamin Cardon) Date: Mon, 27 Feb 2012 10:21:09 -0700 Subject: [Soap-Python] rpclib + Django + Mono/.NET 2.0 Web Services In-Reply-To: <4F4B28AF.3090700@arskom.com.tr> References: <4F4B28AF.3090700@arskom.com.tr> Message-ID: Understood on point 1. I knew that's what was happening I guess, otherwise I would have had no need to make that change. I'll blame it on the lateness :) Rename to django_ seems kind of messy but at least it would work. On point 2, I have forked and issued a pull request fort the Django example. I apparently didn't add the MIT/BSD license headers, though. Perhaps wait until I do that... On point 3, this happens automatically when you do an "Add Web Reference..." in Mono/VS. The resultant .cs file looks like this. (This is slightly different from my previous example because I used the http://127.0.0.1:8000/hello_world/?wsdl URL instead of service.wsdl. http://pastie.org/3473322 On line 77 you can see that a partial class is generated that contains the parameters of the function in question. On line 34, you can see that a function is created that takes this 'say_hello' object as a parameter. This is unfortunately not a pleasant way for this to be handled :( As a point of reference, in Soaplib 0.8.2 this is not the functionality that existed. I also tried to test with this new URL and got the same error message as it tried to post with the ?wsdl tacked on the end. [27/Feb/2012 11:14:34] "POST /hello_world/?wsdl HTTP/1.1" 403 2326 I'm not sure of a resolution to this as the functionality that .NET usually has is that you don't provide a link to the wsdl and it discovers it from the webservice automatically. BJ On Sun, Feb 26, 2012 at 11:54 PM, Burak Arslan wrote: > On 02/27/12 07:09, Benjamin Cardon wrote: > >> First, to get Django and rpclib working together, I had to add this to >> rpclib.server.django: >> >> from __future__ import absolute_import >> >> otherwise I got the error 'no module http'. I am on Ubuntu 11.10, Python >> 2.7.2. Not sure why that was necessary. >> >> > Hi there, > > That's python trying to import from rpclib.server.django module instead of > the root django package. > > http://www.python.org/dev/**peps/pep-0328/ > > the from __future__ import absolute_import hack doest not exist in python > 2.4. I wonder if I should just rename the django module to django_ and be > done with it. > > > > > Second, I have a django project called rpctest with an app called core >> where the view is contained. Here is the code in my Django app. >> >> http://pastie.org/3469070 >> >> > That's exactly how it's supposed to work. > > Is it possible for you to put the full django project inside > examples/django directory and issue a pull request? (make sure to add BSD > or MIT license headers to avoid any confusion) > > Third, I have a basic .NET 2.0 application in MonoDevelop with a Web >> Reference pointing at 127.0.0.1:8000/hello_world/**service.wsdl< >> http://127.0.0.1:8000/hello_**world/service.wsdl> >> and a .NET 2.0 web service that is hooked into it. Here is that code. I >> named the service reference hwmt in my code. >> >> >> http://pastie.org/3469090 >> >> So on to problems? >> >> First problem, I cannot use the web service as functions. The advantage >> to .NET SOAP is that you shouldn't have to do a bunch of object creation >> and stuff to pass simple types but in this case I have to build an object >> and define the types on it. Not very graceful I think. >> >> The bigger problem, though, is that when running the .NET webservice I >> get a 403 error as it tries to access http://127.0.0.1:8000/hello_** >> world/service . >> >> > The canonical way to get an rpclib-generated wsdl is: > http://127.0.0.1:8000/hello_**world/?wsdlbut > 127.0.0.1:8000/hello_world/.**wsdlshould work as well. > > You should try to make a http POST request to just > http://127.0.0.1:8000/hello_**world/ > > Rpclib is tested to be WS-I compliant, so I don't think there should be > any problems with .NET code calling rpclib code. However, AFAIK with .NET, > you need to run the WSDL document through some tool that compiles > definitions in the WSDL document to C# code. Did you already do that? Does > that give any errors? > > hth, > burak > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bj.cardon at gmail.com Mon Feb 27 18:29:50 2012 From: bj.cardon at gmail.com (Benjamin Cardon) Date: Mon, 27 Feb 2012 10:29:50 -0700 Subject: [Soap-Python] rpclib + Django + Mono/.NET 2.0 Web Services In-Reply-To: References: <4F4B28AF.3090700@arskom.com.tr> Message-ID: Actually, after looking at the licenses I'm not sure what to do. Several of the files in a default Django instance are generated by Django. Let me know how you would like me to handle this. BJ On Mon, Feb 27, 2012 at 10:21 AM, Benjamin Cardon wrote: > Understood on point 1. I knew that's what was happening I guess, otherwise > I would have had no need to make that change. I'll blame it on the lateness > :) Rename to django_ seems kind of messy but at least it would work. > > On point 2, I have forked and issued a pull request fort the Django > example. I apparently didn't add the MIT/BSD license headers, though. > Perhaps wait until I do that... > > On point 3, this happens automatically when you do an "Add Web > Reference..." in Mono/VS. The resultant .cs file looks like this. (This is > slightly different from my previous example because I used the > http://127.0.0.1:8000/hello_world/?wsdl URL instead of service.wsdl. > > http://pastie.org/3473322 > > On line 77 you can see that a partial class is generated that contains the > parameters of the function in question. On line 34, you can see that a > function is created that takes this 'say_hello' object as a parameter. This > is unfortunately not a pleasant way for this to be handled :( As a point of > reference, in Soaplib 0.8.2 this is not the functionality that existed. > > I also tried to test with this new URL and got the same error message as > it tried to post with the ?wsdl tacked on the end. > > [27/Feb/2012 11:14:34] "POST /hello_world/?wsdl HTTP/1.1" 403 2326 > > I'm not sure of a resolution to this as the functionality that .NET > usually has is that you don't provide a link to the wsdl and it discovers > it from the webservice automatically. > > BJ > > > On Sun, Feb 26, 2012 at 11:54 PM, Burak Arslan > wrote: > >> On 02/27/12 07:09, Benjamin Cardon wrote: >> >>> First, to get Django and rpclib working together, I had to add this to >>> rpclib.server.django: >>> >>> from __future__ import absolute_import >>> >>> otherwise I got the error 'no module http'. I am on Ubuntu 11.10, Python >>> 2.7.2. Not sure why that was necessary. >>> >>> >> Hi there, >> >> That's python trying to import from rpclib.server.django module instead >> of the root django package. >> >> http://www.python.org/dev/**peps/pep-0328/ >> >> the from __future__ import absolute_import hack doest not exist in python >> 2.4. I wonder if I should just rename the django module to django_ and be >> done with it. >> >> >> >> >> Second, I have a django project called rpctest with an app called core >>> where the view is contained. Here is the code in my Django app. >>> >>> http://pastie.org/3469070 >>> >>> >> That's exactly how it's supposed to work. >> >> Is it possible for you to put the full django project inside >> examples/django directory and issue a pull request? (make sure to add BSD >> or MIT license headers to avoid any confusion) >> >> Third, I have a basic .NET 2.0 application in MonoDevelop with a Web >>> Reference pointing at 127.0.0.1:8000/hello_world/**service.wsdl< >>> http://127.0.0.1:8000/hello_**world/service.wsdl> >>> and a .NET 2.0 web service that is hooked into it. Here is that code. I >>> named the service reference hwmt in my code. >>> >>> >>> http://pastie.org/3469090 >>> >>> So on to problems? >>> >>> First problem, I cannot use the web service as functions. The advantage >>> to .NET SOAP is that you shouldn't have to do a bunch of object creation >>> and stuff to pass simple types but in this case I have to build an object >>> and define the types on it. Not very graceful I think. >>> >>> The bigger problem, though, is that when running the .NET webservice I >>> get a 403 error as it tries to access http://127.0.0.1:8000/hello_** >>> world/service . >>> >>> >> The canonical way to get an rpclib-generated wsdl is: >> http://127.0.0.1:8000/hello_**world/?wsdlbut >> 127.0.0.1:8000/hello_world/.**wsdlshould work as well. >> >> You should try to make a http POST request to just >> http://127.0.0.1:8000/hello_**world/ >> >> Rpclib is tested to be WS-I compliant, so I don't think there should be >> any problems with .NET code calling rpclib code. However, AFAIK with .NET, >> you need to run the WSDL document through some tool that compiles >> definitions in the WSDL document to C# code. Did you already do that? Does >> that give any errors? >> >> hth, >> burak >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Mon Feb 27 22:30:32 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 27 Feb 2012 23:30:32 +0200 Subject: [Soap-Python] rpclib + Django + Mono/.NET 2.0 Web Services In-Reply-To: References: <4F4B28AF.3090700@arskom.com.tr> Message-ID: <4F4BF5F8.6050709@arskom.com.tr> On 02/27/12 19:29, Benjamin Cardon wrote: > Actually, after looking at the licenses I'm not sure what to do. > Several of the files in a default Django instance are generated by > Django. Let me know how you would like me to handle this. > you can add BSD license headers citing your name and email. that's how it is with every other example file, you can have a look at them. burak From bj.cardon at gmail.com Mon Feb 27 21:15:15 2012 From: bj.cardon at gmail.com (Benjamin Cardon) Date: Mon, 27 Feb 2012 13:15:15 -0700 Subject: [Soap-Python] rpclib + Django + Mono/.NET 2.0 Web Services In-Reply-To: <4F4BF5F8.6050709@arskom.com.tr> References: <4F4B28AF.3090700@arskom.com.tr> <4F4BF5F8.6050709@arskom.com.tr> Message-ID: Done. Hopefully that looks good enough :) BJ On Mon, Feb 27, 2012 at 2:30 PM, Burak Arslan wrote: > On 02/27/12 19:29, Benjamin Cardon wrote: > >> Actually, after looking at the licenses I'm not sure what to do. Several >> of the files in a default Django instance are generated by Django. Let me >> know how you would like me to handle this. >> >> > you can add BSD license headers citing your name and email. that's how it > is with every other example file, you can have a look at them. > > burak > -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Mon Feb 27 21:26:30 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 27 Feb 2012 22:26:30 +0200 Subject: [Soap-Python] rpclib + Django + Mono/.NET 2.0 Web Services In-Reply-To: References: <4F4B28AF.3090700@arskom.com.tr> Message-ID: <4F4BE6F6.2090201@arskom.com.tr> On 02/27/12 19:21, Benjamin Cardon wrote: > On line 77 you can see that a partial class is generated that contains > the parameters of the function in question. On line 34, you can see > that a function is created that takes this 'say_hello' object as a > parameter. This is unfortunately not a pleasant way for this to be > handled :( As a point of reference, in Soaplib 0.8.2 this is not the > functionality that existed. > ah. that's because of rpclib's wrapping of function arguments. somebody had started a "bare" branch and did some work there, but didn't finish it. it's still in the project's repository. normally, soap clients (e.g. suds) use some heuristics to detect this and 'sanitize' the soap api. > I also tried to test with this new URL and got the same error message > as it tried to post with the ?wsdl tacked on the end. > > [27/Feb/2012 11:14:34] "POST /hello_world/?wsdl HTTP/1.1" 403 2326 > > I'm not sure of a resolution to this as the functionality that .NET > usually has is that you don't provide a link to the wsdl and it > discovers it from the webservice automatically. I downloaded your fork, run it and got the actual error message for you: http://pastie.org/3474534 Here's the gist of the error: No CSRF or session cookie. does this ring any bells? I guess I've also fixed the relative/absolute import mess. https://github.com/plq/rpclib/commit/ea9ff9e7db77ef5ea74e8798eb102a03feee1c0d best, burak From burak.arslan at arskom.com.tr Mon Feb 27 21:32:32 2012 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Mon, 27 Feb 2012 22:32:32 +0200 Subject: [Soap-Python] PyCon SF Message-ID: <4F4BE860.50607@arskom.com.tr> Hi, If everything goes as planned, I'll be at this year's Pycon US. I also plan to stay for the sprints. Will anyone else be there? We could do a small meetup or something, if anybody'd be interested. See you there :) Best, Burak From bj.cardon at gmail.com Mon Feb 27 21:37:54 2012 From: bj.cardon at gmail.com (Benjamin Cardon) Date: Mon, 27 Feb 2012 13:37:54 -0700 Subject: [Soap-Python] rpclib + Django + Mono/.NET 2.0 Web Services In-Reply-To: <4F4BE6F6.2090201@arskom.com.tr> References: <4F4B28AF.3090700@arskom.com.tr> <4F4BE6F6.2090201@arskom.com.tr> Message-ID: I pushed a small change that will work for now. Django has built in Cross Site Scripting protection which isn't very friendly to curl so I've disabled it on that service. Not ideal for "production" but we aren't production here :) Looks like it's functioning properly now. BJ On Mon, Feb 27, 2012 at 1:26 PM, Burak Arslan wrote: > On 02/27/12 19:21, Benjamin Cardon wrote: > >> On line 77 you can see that a partial class is generated that contains >> the parameters of the function in question. On line 34, you can see that a >> function is created that takes this 'say_hello' object as a parameter. This >> is unfortunately not a pleasant way for this to be handled :( As a point of >> reference, in Soaplib 0.8.2 this is not the functionality that existed. >> >> > ah. that's because of rpclib's wrapping of function arguments. somebody > had started a "bare" branch and did some work there, but didn't finish it. > it's still in the project's repository. > > normally, soap clients (e.g. suds) use some heuristics to detect this and > 'sanitize' the soap api. > > > I also tried to test with this new URL and got the same error message as >> it tried to post with the ?wsdl tacked on the end. >> >> [27/Feb/2012 11:14:34] "POST /hello_world/?wsdl HTTP/1.1" 403 2326 >> >> I'm not sure of a resolution to this as the functionality that .NET >> usually has is that you don't provide a link to the wsdl and it discovers >> it from the webservice automatically. >> > > I downloaded your fork, run it and got the actual error message for you: > http://pastie.org/3474534 > > Here's the gist of the error: > No CSRF or session cookie. > > does this ring any bells? > > I guess I've also fixed the relative/absolute import mess. > https://github.com/plq/rpclib/**commit/**ea9ff9e7db77ef5ea74e8798eb102a** > 03feee1c0d > > best, > burak > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From esiotrot at gmail.com Tue Feb 28 07:15:50 2012 From: esiotrot at gmail.com (Michael Wood) Date: Tue, 28 Feb 2012 08:15:50 +0200 Subject: [Soap-Python] rpclib + Django + Mono/.NET 2.0 Web Services In-Reply-To: References: <4F4B28AF.3090700@arskom.com.tr> <4F4BE6F6.2090201@arskom.com.tr> Message-ID: On 27 February 2012 22:37, Benjamin Cardon wrote: > I pushed a small change that will work for now. Django has built in Cross > Site Scripting protection which isn't very friendly to curl so I've disabled > it on that service. Not ideal for "production" but we aren't production here > :) Just to be picky :) I think you mean Cross Site Request Forgery protection. -- Michael Wood From dsuch at gefira.pl Wed Feb 29 20:34:13 2012 From: dsuch at gefira.pl (Dariusz Suchojad) Date: Wed, 29 Feb 2012 20:34:13 +0100 Subject: [Soap-Python] sec-wall 1.1 / A feature packed security proxy Message-ID: <4F4E7DB5.4090004@gefira.pl> Hello, the version 1.1 of sec-wall has just been released. Notable changes --------------- - Added an 'ssl-wrap-only' option for terminating SSL without requiring clients to provide any authentication information - Simplified access to sec-wall's internals from other Python packages so various authentication methods can be directly imported from Python code What is sec-wall? ----------------- sec-wall is a feature packed security proxy. sec-wall has many interesting features, including support for SSL/TLS, WS-Security, HTTP Auth Basic/Digest, extensible authentication schemes based on custom HTTP headers and XPath expressions, powerful URL matching/rewriting and an optional headers enrichment. sec-wall uses and is built on top of several fantastic Python open source technologies, such as gevent, Spring Python, pesto, lxml, zdaemon or PyYAML and is meant to be highly customizable and easy to use. Good performance, tests, documentation and building an awesome community are at the very heart of the project. Here's an example showing how little is needed to secure a backend server with HTTP Basic Auth. # ###################################################### # -*- coding: utf-8 -*- # stdlib import uuid # Don't share it with anyone. INSTANCE_SECRET = '5bf4e78c256746eda2ce3e0e73f256d0' # May be shared with the outside world. INSTANCE_UNIQUE = uuid.uuid4().hex def default(): return { 'basic-auth':True, 'basic-auth-username':'MyUser', 'basic-auth-password':'MySecret', 'basic-auth-realm':'Secure area', 'host': 'http://example.com' } urls = [ ('/*', default()), ] # ###################################################### Links ----- Project's homepage: http://sec-wall.gefira.pl/ Getting started: http://sec-wall.gefira.pl/documentation/getting-started/index.html Usage examples: http://sec-wall.gefira.pl/documentation/usage-examples/index.html Twitter: https://twitter.com/fourthrealm Blog: http://www.gefira.pl/blog IRC: #sec-wall channel on Freenode network cheers, -- Dariusz Suchojad