]> source.dussan.org Git - gitblit.git/commitdiff
Merge branch 'topic/pr-934' into develop
authorJames Moger <james.moger@gitblit.com>
Mon, 5 Oct 2015 12:12:43 +0000 (08:12 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 5 Oct 2015 12:12:43 +0000 (08:12 -0400)
1  2 
src/main/distrib/data/defaults.properties
src/main/java/com/gitblit/transport/ssh/SshKrbAuthenticator.java

index f88407f4eb167eb8516fa043978c5d7f4ef6d80f,5db6883626a39df693df2ec9da7dbed8bce65dd5..4606f5fc3dfab67faf96a376d72eaff40a51124e
@@@ -138,22 -138,34 +138,28 @@@ git.sshKeysManager = com.gitblit.transp
  # SINCE 1.5.0
  git.sshKeysFolder= ${baseFolder}/ssh
  
 -# Use kerberos5 (GSS) authentication
 +# Use Kerberos5 (GSS) authentication
  #
  # SINCE 1.7.0
 -git.sshWithKrb5 = "false"
 +git.sshWithKrb5 = false
  
 -# The path to a kerberos 5 keytab.
 +# The path to a Kerberos 5 keytab.
  #
  # SINCE 1.7.0
 -git.sshKrb5Keytab = ""
 +git.sshKrb5Keytab = 
  
 -# Strip the domain suffix from a kerberos username.
 -# e.g. james@bigbox would be "james"
 +# The service principal name to be used for Kerberos5.
 +# The default is host/hostname.
  #
  # SINCE 1.7.0
 -git.sshKrb5StripDomain = true
 +git.sshKrb5ServicePrincipalName = 
  
 -# The service principal name to be used for Kerberos5.  The default is host/hostname.
 -#
 -# SINCE 1.7.0
 -git.sshKrb5ServicePrincipalName = ""
 -
 -# A comma-separated list of authentication method. They will be tried in
 -# the given order. Possible values are 
 -# "gssapi-with-mic", "publickey", "keyboard-interactive" or "password"
++# Strip the domain suffix from a kerberos username.
++# e.g. james@bigbox would be "james"
+ #
+ # SINCE 1.7.0
 -git.sshAuthenticatorsOrder = "password,keyboard-interactive,publickey"
++git.sshKrb5StripDomain = true
  # SSH backend NIO2|MINA.
  #
  # The Apache Mina project recommends using the NIO2 backend.
index 4afc00fc6a1a2b59bf9499c01750b669ef3c3e7a,375aa71cbc7e38295c75a0c82538f0eb1cc34246..b6d233cfcb9a723092c47ac2833ca5888476e088
@@@ -31,19 -31,12 +31,23 @@@ public class SshKrbAuthenticator extend
  
        protected final Logger log = LoggerFactory.getLogger(getClass());
        protected final IAuthenticationManager authManager;
 -      public SshKrbAuthenticator(IAuthenticationManager authManager, IStoredSettings settings) {
+       protected final boolean stripDomain;
 +
 +      public SshKrbAuthenticator(IStoredSettings settings, IAuthenticationManager authManager) {
                this.authManager = authManager;
 -              log.info("registry {}", authManager);
 +
 +              String keytabString = settings.getString(Keys.git.sshKrb5Keytab, "");
 +              if(! keytabString.isEmpty()) {
 +                      setKeytabFile(keytabString);
 +              }
 +
 +              String servicePrincipalName = settings.getString(Keys.git.sshKrb5ServicePrincipalName, "");
 +              if(! servicePrincipalName.isEmpty()) {
 +                      setServicePrincipalName(servicePrincipalName);
 +              }
++
+               this.stripDomain = settings.getBoolean(Keys.git.sshKrb5StripDomain, false);
        }
  
        @Override