Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit reason field to 255 characters in authResponse, while sending close method to amqp clients #84

Merged
merged 1 commit into from
Jun 8, 2022

Conversation

Chinmay1412
Copy link
Contributor

At the moment, we are not restricting reason field in authResponse protobuf, while communicating with external service to authenticate clients. Because of that if the external service sends more than 255 characters in reason field, the amqpprox will not be able to encode the Close connection method properly and will not be able to send the Close method to amqp client. The Close connection method's reason(reply-text) field is defined as short string(not more than 255 characters) in the AMQP 0.9.1 protocol. So this PR actively limit the number of characters in the reason field. And in this way, the client will at-least get the close method, otherwise amqpprox restrict that method from sending because of 255 characters limit.

@Chinmay1412 Chinmay1412 requested review from adamncasey and willhoy June 7, 2022 12:09
true, Reply::Codes::access_refused, reason);
true,
Reply::Codes::access_refused,
reason.substr(0, sendSize));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nice that this is substr on string_view 👍

@Chinmay1412 Chinmay1412 merged commit 5887299 into main Jun 8, 2022
@Chinmay1412 Chinmay1412 deleted the short-str branch June 8, 2022 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants