forked from boostorg/mqtt5
Add re authentication tests
Summary: related to T12015 Reviewers: ivica Reviewed By: ivica Subscribers: miljen, iljazovic Differential Revision: https://repo.mireo.local/D27436
This commit is contained in:
1 parent
1485d5ec8b
commit
d7d0b4c239
6 files changed
+337
-75
No files matched your search
@@ -517,7 +517,7 @@ template <
|
||||
>
|
||||
std::pair<reason_code*, size_t> valid_codes() {
|
||||
static reason_code valid_codes[] = {
|
||||
success, continue_authentication
|
||||
success, continue_authentication, reauthenticate
|
||||
};
|
||||
static size_t len = sizeof(valid_codes) / sizeof(reason_code);
|
||||
return std::make_pair(valid_codes, len);
|
||||
@@ -594,13 +594,13 @@ template <
|
||||
std::pair<reason_code*, size_t> valid_codes() {
|
||||
static reason_code valid_codes[] = {
|
||||
normal_disconnection, unspecified_error,
|
||||
malformed_packet,protocol_error,
|
||||
malformed_packet, protocol_error,
|
||||
implementation_specific_error, not_authorized,
|
||||
server_busy, server_shutting_down,
|
||||
keep_alive_timeout, session_taken_over,
|
||||
topic_filter_invalid, topic_name_invalid,
|
||||
receive_maximum_exceeded, topic_alias_invalid,
|
||||
packet_too_large,message_rate_too_high,
|
||||
packet_too_large, message_rate_too_high,
|
||||
quota_exceeded, administrative_action,
|
||||
payload_format_invalid, retain_not_supported,
|
||||
qos_not_supported, use_another_server,
|
||||
|
||||
@@ -45,6 +45,9 @@ public:
|
||||
}
|
||||
|
||||
void perform() {
|
||||
if (_auth.method().empty())
|
||||
return;
|
||||
|
||||
auto auth_step = auth_step_e::client_initial;
|
||||
return _auth.async_auth(
|
||||
auth_step, "",
|
||||
@@ -55,7 +58,7 @@ public:
|
||||
void perform(decoders::auth_message auth_message) {
|
||||
if (_auth.method().empty())
|
||||
return on_auth_fail(
|
||||
"Unexpected AUTH received.",
|
||||
"Unexpected AUTH received",
|
||||
disconnect_rc_e::protocol_error
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user