Ticket #1879: CSFactorySecurity.2.diff

File CSFactorySecurity.2.diff, 1.3 KB (added by pgstudy, 16 years ago)

security are instantiate at Broker for ServerFacotry

  • pb.py

     
    10231023    protocol = Broker
    10241024    unsafeTracebacks = 0
    10251025
    1026     def __init__(self):
     1026    def __init__(self,security=globalSecurity):
    10271027        self._reset()
     1028        self.security=security
    10281029
    10291030    def _reset(self):
    10301031        self.rootObjectRequests = [] # list of deferred
     
    10521053
    10531054    def clientConnectionMade(self, broker):
    10541055        self._broker = broker
     1056        self._broker.security=self.security
    10551057        self._root = broker.remoteForName("root")
    10561058        ds = self.rootObjectRequests
    10571059        self.rootObjectRequests = []
     
    11161118    # object broker factory
    11171119    protocol = Broker
    11181120
    1119     def __init__(self, root, unsafeTracebacks=False):
     1121    def __init__(self, root, unsafeTracebacks=False,security=globalSecurity):
    11201122        self.root = IPBRoot(root)
    11211123        self.unsafeTracebacks = unsafeTracebacks
     1124        self.security=security
    11221125
    11231126    def buildProtocol(self, addr):
    11241127        """Return a Broker attached to me (as the service provider).
    11251128        """
    1126         proto = self.protocol(0)
     1129        proto = self.protocol(0, security=self.security)
    11271130        proto.factory = self
    11281131        proto.setNameForLocal("root", self.root.rootObject(proto))
    11291132        return proto