Skip to content

Commit 1afeccc

Browse files
committed
Extend documentation in default.properties and LdapKeyManager.java.
1 parent 40040b6 commit 1afeccc

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

src/main/distrib/data/defaults.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,11 @@ realm.ldap.uid = uid
19381938
# Attribute on the USER record that indicates their public SSH key.
19391939
# Leave blank when public SSH keys shall not be retrieved from LDAP.
19401940
#
1941-
# This may be a simple attribute or an attribute and a value prefix. Examples:
1941+
# This setting is only relevant when a public key manager is used that
1942+
# retrieves SSH keys from LDAP (e.g. com.gitblit.transport.ssh.LdapKeyManager).
1943+
#
1944+
# The accepted format of the value is dependent on the public key manager used.
1945+
# Examples:
19421946
# sshPublicKey - Use the attribute 'sshPublicKey' on the user record.
19431947
# altSecurityIdentities:SshKey - Use the attribute 'altSecurityIdentities'
19441948
# on the user record, for which the record value

src/main/java/com/gitblit/transport/ssh/LdapKeyManager.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,36 @@
4444
import com.unboundid.ldap.sdk.SearchResultEntry;
4545

4646
/**
47-
* LDAP public key manager
47+
* LDAP-only public key manager
4848
*
4949
* Retrieves public keys from user's LDAP entries. Using this key manager,
5050
* no SSH keys can be edited, i.e. added, removed, permissions changed, etc.
5151
*
52+
* This key manager supports SSH key entries in LDAP of the following form:
53+
* [<prefix>:] [<options>] <type> <key> [<comment>]
54+
* This follows the required form of entries in the authenticated_keys file,
55+
* with an additional optional prefix. Key entries must have a key type
56+
* (like "ssh-rsa") and a key, and may have a comment at the end.
57+
*
58+
* An entry may specify login options as specified for the authorized_keys file.
59+
* The 'environment' option may be used to set the permissions for the key
60+
* by setting a 'gbPerm' environment variable. The key manager will interpret
61+
* such a environment variable option and use the set permission string to set
62+
* the permission on the key in Gitblit. Example:
63+
* environment="gbPerm=V",pty ssh-rsa AAAxjka.....dv= Clone only key
64+
* Above entry would create a RSA key with the comment "Clone only key" and
65+
* set the key permission to CLONE. All other options are ignored.
66+
*
67+
* In Active Directory SSH public keys are sometimes stored in the attribute
68+
* 'altSecurityIdentity'. The attribute value is usually prefixed by a type
69+
* identifier. LDAP entries could have the following attribute values:
70+
* altSecurityIdentity: X.509: ADKEJBAKDBZUPABBD...
71+
* altSecurityIdentity: SshKey: ssh-dsa AAAAknenazuzucbhda...
72+
* This key manager supports this by allowing an optional prefix to identify
73+
* SSH keys. The prefix to be used should be set in the 'realm.ldap.sshPublicKey'
74+
* setting by separating it from the attribute name with a colon, e.g.:
75+
* realm.ldap.sshPublicKey = altSecurityIdentity:SshKey
76+
*
5277
* @author Florian Zschocke
5378
*
5479
*/

0 commit comments

Comments
 (0)