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

Rename login_whitelist_ip config to login_allowlist_ip #16413

Merged
merged 8 commits into from Oct 1, 2020
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Sep 9, 2020

Not needed in developer changelog as we automatically migrate existing setting and if that doesn't work then we still support previous settings for BC (important as it is a security related feature, not always do config changes work eg when they forget to distribute it across multiple servers etc). Also it's not a developer setting but just a regular user setting.

Also renames login_whitelist_apply_to_reporting_api_requests to login_allowlist_apply_to_reporting_api_requests

once merged will need to update the FAQ (I'll do this)

@tsteur tsteur added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Sep 9, 2020
@tsteur tsteur added this to the 4.0.0 RC milestone Sep 9, 2020
@tsteur tsteur added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Sep 9, 2020
@tsteur tsteur changed the title Rename login whitelist to allowlist Rename login_whitelist_ip config to login_allowlist_ip Sep 9, 2020
config/global.ini.php Show resolved Hide resolved
config/global.ini.php Show resolved Hide resolved
core/API/Request.php Outdated Show resolved Hide resolved
config/global.php Show resolved Hide resolved
@@ -60,72 +60,85 @@ public function tearDown(): void

public function test_shouldWhitelistApplyToAPI_shouldBeEnabledByDefault()
{
$this->assertTrue($this->whitelist->shouldWhitelistApplyToAPI());
$this->assertTrue($this->allowlist->shouldAllowlistApplyToAPI());
}

public function test_shouldWhitelistApplyToAPI_canBeDisabled()
{
$this->setGeneralConfig('login_whitelist_apply_to_reporting_api_requests', '0');
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
$this->setGeneralConfig('login_whitelist_apply_to_reporting_api_requests', '0');
$this->setGeneralConfig('login_allowlist_apply_to_reporting_api_requests', '0');

That should fix the failing test

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll commit this separately. I partially left some with whitelist to make sure we still support the previous setting re BC but will rather add an extra test for it

@tsteur
Copy link
Member Author

tsteur commented Sep 30, 2020

@sgiehl applied the review comments. replaced the word also in few other places but not in places like the validator or so when it requires changes across plugins as it's not as easy to do and needs a separate PR anyway

{
$general = $this->getGeneralConfig();
return !empty($general['login_whitelist_apply_to_reporting_api_requests']);
return !empty($general['login_allowlist_apply_to_reporting_api_requests']) || !empty($general['login_whitelist_apply_to_reporting_api_requests']);
Copy link
Member

Choose a reason for hiding this comment

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

The fallback to the old name might actually not work as expected in all cases as the default value of those setting is 1.
Lets say someone does not configure login_allowlist_apply_to_reporting_api_requests, but uses login_whitelist_apply_to_reporting_api_requests = 0. That would actually not work, as login_allowlist_apply_to_reporting_api_requests defaults to 1.

I guess that might be fine, as login_allowlist_apply_to_reporting_api_requests will be set on update if needed, but actually I think we could remove the fallback here then...

@sgiehl
Copy link
Member

sgiehl commented Oct 1, 2020

Seems you added the screenshot directly, and not to LFS...

@tsteur
Copy link
Member Author

tsteur commented Oct 1, 2020

fixed

@tsteur tsteur merged commit 8218659 into 4.x-dev Oct 1, 2020
@tsteur tsteur deleted the loginallowlist branch October 1, 2020 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants