| 435 | |
| 436 | |
| 437 | class CredentialsMessage(_MessageType): |
| 438 | opcode = 0x04 |
| 439 | name = 'CREDENTIALS' |
| 440 | |
| 441 | def __init__(self, creds): |
| 442 | self.creds = creds |
| 443 | |
| 444 | def send_body(self, f, protocol_version): |
| 445 | if protocol_version > 1: |
| 446 | raise UnsupportedOperation( |
| 447 | "Credentials-based authentication is not supported with " |
| 448 | "protocol version 2 or higher. Use the SASL authentication " |
| 449 | "mechanism instead.") |
| 450 | write_short(f, len(self.creds)) |
| 451 | for credkey, credval in self.creds.items(): |
| 452 | write_string(f, credkey) |
| 453 | write_string(f, credval) |
| 454 | |
| 455 | |
| 456 | class AuthChallengeMessage(_MessageType): |
no outgoing calls
no test coverage detected