|
44 | 44 | import com.unboundid.ldap.sdk.SearchResultEntry; |
45 | 45 |
|
46 | 46 | /** |
47 | | - * LDAP public key manager |
| 47 | + * LDAP-only public key manager |
48 | 48 | * |
49 | 49 | * Retrieves public keys from user's LDAP entries. Using this key manager, |
50 | 50 | * no SSH keys can be edited, i.e. added, removed, permissions changed, etc. |
51 | 51 | * |
| 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 | + * |
52 | 77 | * @author Florian Zschocke |
53 | 78 | * |
54 | 79 | */ |
|
0 commit comments