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

Settings getGroups does not play well with secured settings #25069

Closed
dadoonet opened this issue Jun 6, 2017 · 0 comments · Fixed by #25076
Closed

Settings getGroups does not play well with secured settings #25069

dadoonet opened this issue Jun 6, 2017 · 0 comments · Fixed by #25076
Assignees
Labels
>bug :Core/Infra/Settings Settings infrastructure and APIs

Comments

@dadoonet
Copy link
Member

dadoonet commented Jun 6, 2017

Follow up of #25064

This test example shows the problem:

    public void testGroupsWithSecuredSettings() {
        MockSecureSettings secureSettings = new MockSecureSettings();
        secureSettings.setString("s3.client.myconfig.access_key", "myconfig_key");
        secureSettings.setString("s3.client.myconfig.secret_key", "myconfig_secret");
        secureSettings.setString("s3.client.default.access_key", "default_key");
        secureSettings.setString("s3.client.default.secret_key", "default_secret");
        Settings settings = Settings.builder().setSecureSettings(secureSettings).build();

        assertThat(settings.getGroups("s3.client.").keySet(), containsInAnyOrder("myconfig", "default"));
    }

This gives:

java.lang.AssertionError: 
Expected: iterable over ["myconfig", "default"] in any order
     but: No item matches: "myconfig", "default" in []
@dadoonet dadoonet added :Core/Infra/Settings Settings infrastructure and APIs >bug labels Jun 6, 2017
rjernst added a commit to rjernst/elasticsearch that referenced this issue Jun 6, 2017
This commit fixes the group methdos of Settings to properly include
grouped secure settings. Previously the secure settings were included
but without the group prefix being removed.

closes elastic#25069
rjernst added a commit that referenced this issue Jun 6, 2017
This commit fixes the group methdos of Settings to properly include
grouped secure settings. Previously the secure settings were included
but without the group prefix being removed.

closes #25069
rjernst added a commit that referenced this issue Jun 6, 2017
This commit fixes the group methdos of Settings to properly include
grouped secure settings. Previously the secure settings were included
but without the group prefix being removed.

closes #25069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Core/Infra/Settings Settings infrastructure and APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants