(self)
| 127 | self.connection.shutdown(1) |
| 128 | |
| 129 | def APIAuthenticateClient(self): |
| 130 | if 'Authorization' in self.headers: |
| 131 | # handle Basic authentication |
| 132 | (enctype, encstr) = self.headers.get('Authorization').split() |
| 133 | (emailid, password) = encstr.decode('base64').split(':') |
| 134 | if emailid == BMConfigParser().get('bitmessagesettings', 'apiusername') and password == BMConfigParser().get('bitmessagesettings', 'apipassword'): |
| 135 | return True |
| 136 | else: |
| 137 | return False |
| 138 | else: |
| 139 | logger.warn('Authentication failed because header lacks Authentication field') |
| 140 | time.sleep(2) |
| 141 | return False |
| 142 | |
| 143 | return False |
| 144 | |
| 145 | def _decode(self, text, decode_type): |
| 146 | try: |
no test coverage detected