-
Notifications
You must be signed in to change notification settings - Fork 66
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
Modified WinRM classes to work with IBM JDK #130
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2008-2014, XebiaLabs B.V., All rights reserved. | ||
* | ||
* | ||
* Overthere is licensed under the terms of the GPLv2 | ||
* <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most XebiaLabs Libraries. | ||
* There are special exceptions to the terms and conditions of the GPLv2 as it is applied to | ||
* this software, see the FLOSS License Exception | ||
* <http://github.com/xebialabs/overthere/blob/master/LICENSE>. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under the terms | ||
* of the GNU General Public License as published by the Free Software Foundation; version 2 | ||
* of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with this | ||
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth | ||
* Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
package com.xebialabs.overthere.cifs.winrm; | ||
|
||
import java.util.HashMap; | ||
import javax.security.auth.login.AppConfigurationEntry; | ||
import javax.security.auth.login.Configuration; | ||
|
||
class JavaVendor { | ||
|
||
private static final boolean IBM_JAVA = System.getProperty("java.vendor").contains("IBM"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor about this one...do we know whether Also some minor style issues in this class: spacing and indents. |
||
|
||
public static boolean isIBM() { | ||
return IBM_JAVA; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,16 +37,27 @@ class KerberosJaasConfiguration extends Configuration { | |
@Override | ||
public AppConfigurationEntry[] getAppConfigurationEntry(String s) { | ||
final HashMap<String, String> options = new HashMap<String, String>(); | ||
options.put("client", "true"); | ||
options.put("useTicketCache", "false"); | ||
options.put("useKeyTab", "false"); | ||
options.put("doNotPrompt", "false"); | ||
options.put("refreshKrb5Config", "true"); | ||
if (debug) { | ||
options.put("debug", "true"); | ||
|
||
if (JavaVendor.isIBM()) { | ||
options.put("refreshKrb5Config", "true"); | ||
} else { | ||
options.put("client", "true"); | ||
options.put("useTicketCache", "false"); | ||
options.put("useKeyTab", "false"); | ||
options.put("doNotPrompt", "false"); | ||
options.put("refreshKrb5Config", "true"); | ||
if (debug) { | ||
options.put("debug", "true"); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are none of these options supported on the IBM JDK? If so, does this need to be documented somewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me first say I'm really not an expert on this.. I could have added useCcache and useKeyTab, but they are false by default so I figured it wasn't necessary. I'll try to add credsType=initiator, I guess that equals the client=true option for Oracle JDK. |
||
} | ||
return new AppConfigurationEntry[]{new AppConfigurationEntry("com.sun.security.auth.module.Krb5LoginModule", | ||
|
||
return new AppConfigurationEntry[]{new AppConfigurationEntry(getKrb5LoginModuleName(), | ||
AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, options)}; | ||
} | ||
|
||
private String getKrb5LoginModuleName() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [minor] Can be |
||
return (JavaVendor.isIBM() ? "com.ibm.security.auth.module.Krb5LoginModule" | ||
: "com.sun.security.auth.module.Krb5LoginModule"); | ||
} | ||
|
||
} |
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.
[minor] Rename this to
SystemConfig
or so? I can imagine we'll need to get other type of system-level data. I guess the method would then be calledisIbmJdk
or so...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.
Let's first see what all ends up in here, ie. the other methods which switch on the isIBM, see below