-
Notifications
You must be signed in to change notification settings - Fork 4k
Policy validation could let invalid values in #1999
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
Conversation
Any other value will break the validation cycle and leave the rest of the arguments without validate [#165689664]
validate_policy(KeyList) -> | ||
case proplists:lookup(<<"queue-master-locator">> , KeyList) of | ||
{_, Strategy} -> validate_strategy(Strategy); | ||
{_, Strategy} -> case validate_strategy(Strategy) of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must be missing something, but I don't see how validate_strategy/1
can return anything other than {ok, _}
or {error, "~p invalid queue-master-locator value", [Strategy]}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validate_policy/1
should return either ok
or {error, term()}
, but not {ok, term()}
. https://github.com/rabbitmq/rabbitmq-server/blob/master/src/rabbit_policy.erl#L528
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like fixing the original issue.
Can you add a test case in policy validation to cover that?
[#165689664]
@hairyhum Test just added |
Policy validation must return 'ok' or an error (cherry picked from commit 3cfcacb)
Backported to |
Any other value will break the validation cycle and leave the rest of the arguments without validate
Reported in the mailing list: https://groups.google.com/forum/#!topic/rabbitmq-users/7mwL2AWwUyI
Types of Changes
Checklist
CONTRIBUTING.md
documentFurther Comments
If this is a relatively large or complex change, kick off the discussion by
explaining why you chose the solution you did and what alternatives you
considered, etc.