Example #1
0
    def setUp(self):
        self.root = inmemory.ReadOnlyInMemoryLDAPEntry(
            dn='dc=example,dc=com', attributes={'dc': 'example'})
        self.user = self.root.addChild(
            rdn='cn=bob',
            attributes={
                'objectClass': ['a', 'b'],
                # Hash is for "secret".
                'userPassword': ['{SSHA}yVLLj62rFf3kDAbzwEU0zYAVvbWrze8='],
                'userPrincipalName': ['*****@*****.**'],
            })

        server = ldaptor_with_upn_bind.LDAPServerWithUPNBind()
        server.factory = self.root
        server.transport = proto_helpers.StringTransport()
        server.connectionMade()
        self.server = server
Example #2
0
    def setUp(self):
        self.root = inmemory.ReadOnlyInMemoryLDAPEntry(
            dn="dc=example,dc=com", attributes={"dc": "example"})
        self.user = self.root.addChild(
            rdn=b"cn=bob",
            attributes={
                "objectClass": ["a", "b"],
                # Hash is for "secret".
                "userPassword": [b"{SSHA}yVLLj62rFf3kDAbzwEU0zYAVvbWrze8="],
                "userPrincipalName": ["*****@*****.**"],
            },
        )

        server = ldaptor_with_upn_bind.LDAPServerWithUPNBind()
        server.factory = self.root
        server.transport = proto_helpers.StringTransport()
        server.connectionMade()
        self.server = server