[Twisted-Python] Newbie: using cred strcred.AuthOptionMixin

2010-07-06 Thread Schneider
Hi,

I need a perspective broker with authentification and followed the Twisted
documentation on
http://twistedmatrix.com/documents/current/core/howto/tap.html#auto4 to get
the twistd plugin to work. Now I want to make it work with the /etc/shadow,
but don't know how to get it to work.  

The plugin looks like:
---
from zope.interface import implements
from twisted.python import usage
from twisted.plugin import IPlugin
from twisted.application.service import IServiceMaker from
twisted.application import internet from twisted.cred import credentials,
portal, strcred from twisted.spread import pb

from qxmt.QXMTServer import QXMTUser

class Options(usage.Options, strcred.AuthOptionMixin):
# This part is optional; it tells AuthOptionMixin what
# kinds of credential interfaces the user can give us.
supportedInterfaces = (credentials.IUsernamePassword,)

optParameters = [["port", "p", 8789, "Server port number"]]


class QXMTRealm:
implements(portal.IRealm)
def requestAvatar(self, avatarId, mind, *interfaces):
if pb.IPerspective not in interfaces:
raise NotImplementedError
return pb.IPerspective, QXMTUser(avatarId), lambda: None

class QXMTServiceMaker(object):
implements(IServiceMaker, IPlugin)
tapname = "qxmt"
description = "The QXtend remote error processing tool."
options = Options

def makeService(self, options):
"""
Construct a TCPServer from a factory defined in qxmt.
"""
p = portal.Portal(QXMTRealm(), options["credCheckers"])
#c = checkers.InMemoryUsernamePasswordDatabaseDontUse(user1="pass1",
#p.registerChecker(c)
return internet.TCPServer(int(options['port']),
  pb.PBServerFactory(p))

serviceMaker = QXMTServiceMaker()
---

Running twistd qxmt --help-auth gives

Usage: --auth AuthType[:ArgString]
For detailed help: --help-auth-type AuthType

  AuthType  ArgString format
    
  memoryA colon-separated list (name:password:...)
  file  Location of a FilePasswordDB-formatted file.
  unix  No argstring required.

And twistd qxmt --help-auth-type unix gives

Usage: --auth unix[:ArgString]
ArgString format: No argstring required.

  This checker will attempt to use every resource available to
  authenticate against the list of users on the local UNIX system.
  (This does not support Windows servers for very obvious reasons.)

  Right now, this includes support for:

* Python's pwd module (which checks /etc/passwd)
* Python's spwd module (which checks /etc/shadow)

  Future versions may include support for PAM authentication. 

So, I guess the server now should be able to use the system's shadow
passwords for authentification.

As a client I used with the InMemoryUsernamePasswordDatabaseDontUse checker
the following code.

---
#!/usr/bin/env python

# Copyright (c) 2009 Twisted Matrix Laboratories.
# See LICENSE for details.

from twisted.spread import pb
from twisted.internet import reactor
from twisted.cred import credentials

def main():
factory = pb.PBClientFactory()
reactor.connectTCP("localhost", 8789, factory)
def1 = factory.login(credentials.UsernamePassword("user1", "pass1"))
def1.addCallback(connected)
reactor.run()

def connected(perspective):
print "got perspective1 ref:", perspective
print "asking it to foo(13)"
perspective.callRemote("foo", 13)

main()
---

How to rewrite the client to make it work with --auth=unix ?

Thanks,

Frans





___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Newbie: using cred strcred.AuthOptionMixin

2010-07-06 Thread exarkun
On 11:31 am, f.schnei...@de-bleek.demon.nl wrote:
>Hi,
>
>I need a perspective broker with authentification and followed the 
>Twisted
>documentation on
>http://twistedmatrix.com/documents/current/core/howto/tap.html#auto4 to 
>get
>the twistd plugin to work. Now I want to make it work with the 
>/etc/shadow,
>but don't know how to get it to work.

The /etc/shadow cred plugin supports checking IUsernamePassword 
credentials.  PBServerFactory creates protocol instances that only know 
how to check IUsernameHashedPassword, IUsernameMD5Password, and 
IAnonymous credentials, though.  So no clients will be able to 
authenticate with this configuration.

You can add support for new credentials types to your PB server by 
creating the PBServerFactory with an IPBRoot provider that returns a 
root object (typically a Referenceable instance) with a "remote_login" 
method - or any other method that you make your PBClientFactory's login 
method call with credentials information.

The most straightforward thing to implement would be simple 
username/password authentication where the client sends both pieces of 
information to the server and the server verifies them.  This would only 
be secure if used over a secure transport such as SSL, of course.

It might also help to look at how authentication is implemented now, in 
twisted/spread/pb.py, in the _PortalRoot, _PortalWrapper, and 
_PortalAuthChallenger.

Jean-Paul

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Advice seeked on SMPP implementation

2010-07-06 Thread Yaroslav Fedevych
Thanks a lot for reply,

however turns out that most SMPP appliances behave in a way rather
different than your average mailbox/IM sessions. So I will in fact
need to reinvent a wheel... This, however, has little to do with
actual SMPProtocol class. Bridging it with t.words or even t.mail
would cover only a tiny fraction of use cases (most of which are in
fact routing, throttling and charging for the messages sent in bulk,
and sending messages in bulk).

-- 
Engineer : How do I do it?
Economist : How much will it cost?
Twisted Developer: But does it block?

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Newbie: using cred strcred.AuthOptionMixin

2010-07-06 Thread Schneider
Thanks for the reply.

For a newbie, that's a little too much. I'll stick to a simple
username/password file checking for the moment.

Frans


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] 10.1 release follow-up

2010-07-06 Thread Jonathan Lange
On Tue, Jul 6, 2010 at 4:08 AM, Glyph Lefkowitz  wrote:
>
> On Jul 4, 2010, at 12:13 PM, Jonathan Lange wrote:
...
>> I've started this thread for any discussions about the way the release
>> was done and for the next release.
>
> I am generally very pleased with the way it went.  It appears to have been
> the smoothest release thus far.
>

It's certainly the smoothest I've done.

I can't stress how amazingly helpful it is to have a detailed process
doc, and how important it is to see any glitches in the release as
bugs in the document.

>> Note that the Ubuntu feature freeze is August 12th, so we can expect
>> 10.1 to be the release that goes into Ubuntu 10.10.
>
> I would *like* to accelerate the schedule for this release if we can get
> certain important features in which missed the last release (documentation
> for endpoints, documentation for cancellation, endpoint string parsing,
> endpoint plugins, and some SSL issues that Jean-Paul and I discovered while
> working on these).  It would be nice to establish the precedent that
> important features cause releases to happen *faster*, rather than causing
> them to be delayed.

I would like the same.

I was going to say that maybe those things are worth doing a 10.1.1
release for, but then I thought better. Let's keep point releases for
critical defects.

> But I certainly don't want to make any promises about getting it done by a
> particular advance date.  I thought that you handled the delays and setbacks
> in this release fairly well - I can't see myself doing it substantially
> better - and so trying to accelerate the schedule may just result in the
> release actually occurring on time.
>

Making promises about time is difficult for unpaid volunteers. :)

>> As part of this release, there have been many improvements to the
>> release process document, see
>> http://twistedmatrix.com/trac/wiki/ReleaseProcess. I would greatly
>> appreciate it if the document could be reviewed for clarity and
>> correctness.
>
> I will obviously be doing this in more detail as I move forward with the
> next release, but the recent edits are a big improvement to the clarity and
> completeness of the document.

Thanks.

It's basically only possible to test the document by doing a release.
My brain turns to cheese whenever I try to review it while not
actually doing something.

>
>> The biggest blockers to a swift release, from my perspective, were the
>> following:
...
>
>  * delaying to wait for feedback on the release candidate
>
> This seems to me like a necessary delay.  I wish that we could motivate the
> readers of this mailing list to be a bit more responsive, but I don't see
> how we could have been much louder about it :).
>

I think I should have announced the closing date for testing (as in,
if it's not in by June Xth, we aren't going to do know about it).

>  * waiting for the review for the release ticket
>  * waiting for someone else to solve the buildbot issues for Windows
>
> It looks like those issues were a one-time thing, at least.
>

The delay on waiting for the ticket to be reviewed happened last time also.

I don't really have any ideas as to what to do about it, but I'd like
to avoid the experience of sitting around for hours killing time at my
computer on a weekend waiting for a review that may never come.

jml

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] 10.1 release follow-up

2010-07-06 Thread Tim Allen
On Tue, Jul 06, 2010 at 02:09:47PM +0100, Jonathan Lange wrote:
> The delay on waiting for the ticket to be reviewed happened last time also.
> 
> I don't really have any ideas as to what to do about it, but I'd like
> to avoid the experience of sitting around for hours killing time at my
> computer on a weekend waiting for a review that may never come.

This might be an argument for always having two people go through the
release process together: firstly, so that one can write the ticket and
the other can review it, and secondly to keep the release process Bus
Factor above 1:


http://twistedmatrix.com/trac/browser/tags/releases/twisted-10.1.0/twisted/python/_release.py#L29

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Lore to Sphinx Conversion Progress Report 6

2010-07-06 Thread Jonathan Lange
On Fri, Mar 5, 2010 at 7:33 PM, Kevin Horn  wrote:
...
> As far as I know, there aren't any tickets in Trac yet.  I was planning on
> making some (or asking others to do so) once a "master ticket" and a branch
> are created.
>

I have filed such a master ticket here:
  http://twistedmatrix.com/trac/ticket/4553

And created a milestone here:
  http://twistedmatrix.com/trac/milestone/Lore%20to%20Sphinx

You should probably add any new tickets you file to the milestone.

Personally, I'd love to see the transition happen.

jml

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Lore to Sphinx Conversion Progress Report 6

2010-07-06 Thread Jonathan Lange
On Tue, Jul 6, 2010 at 8:16 PM, Jonathan Lange  wrote:
> On Fri, Mar 5, 2010 at 7:33 PM, Kevin Horn  wrote:
> ...
>> As far as I know, there aren't any tickets in Trac yet.  I was planning on
>> making some (or asking others to do so) once a "master ticket" and a branch
>> are created.
>>
>
> I have filed such a master ticket here:
>  http://twistedmatrix.com/trac/ticket/4553
>
> And created a milestone here:
>  http://twistedmatrix.com/trac/milestone/Lore%20to%20Sphinx
>
> You should probably add any new tickets you file to the milestone.
>

Hey and look a ticket was already filed (#4500) and
http://twistedsphinx.funsize.net/transition_plan.html is out of date
:)

jml

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] twisted 10.1 ppa

2010-07-06 Thread m . beyer5
Hi,

I'm anxious to try out the new 10.1 release.
Please push it to the ppa to make it easily accessable. 

Thanks :)

Marcus
-- 
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl

-- 
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Lore to Sphinx Conversion Progress Report 6

2010-07-06 Thread Kevin Horn
On Tue, Jul 6, 2010 at 1:27 PM, Jonathan Lange  wrote:

> On Tue, Jul 6, 2010 at 8:16 PM, Jonathan Lange  wrote:
> > On Fri, Mar 5, 2010 at 7:33 PM, Kevin Horn  wrote:
> > ...
> >> As far as I know, there aren't any tickets in Trac yet.  I was planning
> on
> >> making some (or asking others to do so) once a "master ticket" and a
> branch
> >> are created.
> >>
> >
> > I have filed such a master ticket here:
> >  http://twistedmatrix.com/trac/ticket/4553
> >
> > And created a milestone here:
> >  http://twistedmatrix.com/trac/milestone/Lore%20to%20Sphinx
> >
> > You should probably add any new tickets you file to the milestone.
> >
>
> Hey and look a ticket was already filed (#4500) and
> http://twistedsphinx.funsize.net/transition_plan.html is out of date
> :)
>
> jml
>
>
>
Doh! Sorry about that... I didn't realize anyone was actually looking at it.
:)

So now that Jonathan has cut the 10.1 release, my plan is to start the
conversion process pretty soon (meaning sometime between tonight and
Wednesday).

Once I have the branch created and the basic conversion completed it would
be really great to have some help with the (yet to be created) "chunk
tickets".

We're getting really close...

Kevin Horn
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python