Hi Colm, You test is actually working as expected. KdcServer settings come from two aspects: manually values from the call using the set* methods of KdcServer, and values from KdcConfig. Please note the manual setting values will not affect the KdcConfig.
I just added two tests inspired by your codes. Thanks. commit 46bfd66c1eff6dab934f1f06d12cad1adb3972b2 Author: Drankye <[email protected]> Date: Tue Apr 21 06:52:30 2015 +0800 Added kdc setting test and KrbClient setting test, inspired by Colm The fixed test: @Test public void testKdcServerMannualSetting() { KdcServer kerbServer = new KdcServer(); kerbServer.setKdcHost("localhost"); kerbServer.setKdcRealm("TEST2.COM"); kerbServer.setKdcTcpPort(12345); kerbServer.init(); KdcSetting kdcSetting = kerbServer.getSetting(); assertThat(kdcSetting.getKdcHost()).isEqualTo("localhost"); assertThat(kdcSetting.getKdcTcpPort()).isEqualTo(12345); assertThat(kdcSetting.getKdcRealm()).isEqualTo("TEST2.COM"); } Regards, Kai From: Colm O hEigeartaigh [mailto:[email protected]] Sent: Monday, April 20, 2015 10:33 PM To: Apache Directory Developers List Subject: Re: Kerby KdcConfig question Thanks Kai! Here is another test that is not working as expected - or am I doing something wrong? @Test public void testManualConfigurationTestKdcServer() { KdcServer kerbServer = new KdcServer(); kerbServer.setKdcHost("localhost"); kerbServer.setKdcRealm("TEST2.COM<http://TEST2.COM>"); kerbServer.setKdcTcpPort(12345); kerbServer.init(); KdcConfig kdcConfig = kerbServer.getSetting().getKdcConfig(); assertThat(kdcConfig.getKdcHost()).isEqualTo("localhost"); assertThat(kdcConfig.getKdcTcpPort()).isEqualTo(12345); assertThat(kdcConfig.getKdcRealm()).isEqualTo("TEST2.COM<http://TEST2.COM>"); } Colm. On Mon, Apr 20, 2015 at 1:32 PM, Zheng, Kai <[email protected]<mailto:[email protected]>> wrote: Colm, Please check out for the fix. Please review, thank. commit 9dca2d22abc9c32707ca8535f9ec231b40ad25a0 Author: Drankye <[email protected]<mailto:[email protected]>> Date: Mon Apr 20 20:29:05 2015 +0800 Fixed some issues found in KdcConfig and KrbSetting. Thanks Colm Regards, Kai From: Zheng, Kai [mailto:[email protected]<mailto:[email protected]>] Sent: Monday, April 20, 2015 7:50 PM To: [email protected]<mailto:[email protected]> Cc: Apache Directory Developers List Subject: RE: Kerby KdcConfig question Hi Colm, It’s definitely a bug, thanks for your codes repeating it! It was introduced some time ago when introducing the set of set APIs for configuration. I’m working on a fix. Regards, Kai From: Colm O hEigeartaigh [mailto:[email protected]] Sent: Monday, April 20, 2015 6:57 PM To: Zheng, Kai Cc: Apache Directory Developers List Subject: Re: Kerby KdcConfig question Hi Kai, Thanks for your response. See inline: TestKdcServer uses the realm “TEST.COM<http://TEST.COM>” and I don’t see test failures. What effect are you expecting, or would you let know how to repeat the issue? Maybe you could simplify and illustrate the issue in TestKdcConfigLoad? Thanks. The problem occurs when I try to set values for the KdcConfig manually (as opposed to reading them in via a ".ini" file). So see the following test (in TestKdcConfigLoad): @Test public void testManualConfiguration() throws URISyntaxException, IOException { KdcConfig kdcConfig = new KdcConfig(); kdcConfig.setString(KdcConfigKey.KDC_HOST, "localhost"); kdcConfig.setInt(KdcConfigKey.KDC_TCP_PORT, 12345); kdcConfig.setString(KdcConfigKey.KDC_REALM, "TEST2.COM<http://TEST2.COM>"); assertThat(kdcConfig.getKdcHost()).isEqualTo("localhost"); assertThat(kdcConfig.getKdcTcpPort()).isEqualTo(12345); assertThat(kdcConfig.getKdcRealm()).isEqualTo("TEST2.COM<http://TEST2.COM>"); } All of the assertions here fail. I guess I am doing something wrong with the calls to "setString" and "setInt" etc, but that is what the TestKdcServer does in the "prepareKdcConfig" method. Colm. Regards, Kai From: Colm O hEigeartaigh [mailto:[email protected]<mailto:[email protected]>] Sent: Saturday, April 18, 2015 12:21 AM To: Apache Directory Developers List Subject: Kerby KdcConfig question Hi all, Playing around with Kerby a bit. Something I don't understand is the way we configure the server in KdcConfig. For example: public String getKdcDomain() { return getString(KdcConfigKey.KDC_DOMAIN); } However: public String getKdcRealm() { return KrbConfHelper.getStringUnderSection(this, KdcConfigKey.KDC_REALM); } Why is the realm configured differently to the domain? In the TestKdcServer, the value set by has no effect as a result: kdcConfig.setString(KdcConfigKey.KDC_REALM, "TEST.COM<http://TEST.COM>"); Colm. -- Colm O hEigeartaigh Talend Community Coder http://coders.talend.com -- Colm O hEigeartaigh Talend Community Coder http://coders.talend.com -- Colm O hEigeartaigh Talend Community Coder http://coders.talend.com
