예제 #1
0
파일: sasl.py 프로젝트: smurfix/aio-py-amqp
 def start(self, connection):
     if self.username is None or self.password is None:
         return NotImplemented
     login_response = BytesIO()
     _write_table({b'LOGIN': self.username, b'PASSWORD': self.password},
                  login_response.write, [])
     # Skip the length at the beginning
     return login_response.getvalue()[4:]
예제 #2
0
파일: sasl.py 프로젝트: yancd/py-amqp
 def start(self, connection):
     login_response = BytesIO()
     _write_table({
         b'LOGIN': self.username,
         b'PASSWORD': self.password
     }, login_response.write, [])
     # Skip the length at the beginning
     return login_response.getvalue()[4:]
예제 #3
0
 def test_amqplain(self):
     username, password = '******', 'bar'
     mech = sasl.AMQPLAIN(username, password)
     response = mech.start(None)
     assert isinstance(response, bytes)
     login_response = BytesIO()
     _write_table({b'LOGIN': username, b'PASSWORD': password},
                  login_response.write, [])
     expected_response = login_response.getvalue()[4:]
     assert response == expected_response
예제 #4
0
 def start(self, connection):
     if self.username is None or self.password is None:
         return NotImplemented
     login_response = BytesIO()
     _write_table(
         {b"LOGIN": self.username, b"PASSWORD": self.password},
         login_response.write,
         [],
     )
     # Skip the length at the beginning
     return login_response.getvalue()[4:]