Repository navigation
Reject Layer2 Address Changes if email notifications enabled but email is invalid - #1120
Merged
Merged
Conversation
Member
|
Nice catch @afk11 - I think in the current implementation, you shouldn't be allowed to change the MAC unless there is some form of notification/handling. Right now, it's email or bust - so perhaps just don't allow it in this case rather than not sending the email. |
…er type) and the destination email is invalid, don't permit the change, log + return an error message
…ethod, under same config, so it's easier to reason through tests. an old test relied on a quirt in the ChangeTest, so fixes that
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If notifications are enabled but there's no recipient, entering an email lead to a confusing 'AJAX Request failed' error, but when you refresh, the MAC was actually saved.
Edit: following comment from Barry, approached this a little differently
With this PR, if we are configured to email on superuser/customer changes, and the email is not valid, we disallow the change from taking place.
Making these changes highlighted an quirk in the Listener.. If configured to send email regarding superuser changes (disabled for customers), then modifications by a customer would still trigger an email. This isn't documented, and the two separate configuration values suggest they're independent controls.
I had tests covering the listener, but I'd misconfigured the test case and missed it. So I've rewritten the tests to make it clearer how the config interacts with things.
IXP-Manager/tests/Listeners/Layer2Address/ChangedTest.php
Lines 105 to 116 in 6bc919b