summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Extend documentation in default.properties and LdapKeyManager.java.merged--sshLdapAuthenticatorFlorian Zschocke2016-12-062-2/+31
|
* The public key manager can disable writing keys, which hides commandsFlorian Zschocke2016-12-066-12/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some public key mangers may be read-only, i.e. not allow to add or delete keys, or to change the key comment or assigned permissions. In such a case the respective commands should not be available on the SSH shell and the SSH Keys panel should also not offer the possibility. The `IPublicKeyManager` gets three new methods, modelled after the `AuthenticationManager`: `supportsWritingKeys`, `supportsCommentChanges` and `supportsPermissionChanges`. They return true if a key manager allows for keys to be written or updated. For example the existing `FileKeyManager` will return true for all three since it allows to store and update keys in a file. The new `LdapKeyManager` returns false since it only accesses LDAP and can not add or update any keys in the directory. A future key manager might get keys from an LDAP directory but still keep comments and permissions for it in a local copy. If writing of keys is not supported: * the welcome shell does not suggest adding a key, * the `SshKeysDispatcher` does not offer the "add", "remove", "comment" and "permission" commands, and * the SSH keys panel hides the "delete" button in the key list, and the "Add Key" form. The hiding of the "Add key" form is not perfect since the surrounding div is still shown, but I don't know how to hide it and it didn't look too bad, either.
* Fix SshKeysDispatcher test failing on WindowsFlorian Zschocke2016-12-061-7/+7
| | | | | | | | | The `SshKeysDispatcher` tests that use the keys list command are failing on Windows because they assume a Unix line ending after each key. But the command will use a system line ending. So this fix uses system line endings in the reference string for the assert, too. In addition, two `assertTrue(false)´ are replaced with a proper `fail`.
* Use dynamic port selection for LDAP listeners in LDAP tests.Florian Zschocke2016-12-061-10/+11
| | | | | | | Instead of using fixed ports for the listeners of the in-memory LDAP server, let the listeners select ports and then save them in the authentication mode instance. This way we prevent port collisions, which especially showed up under Windows.
* Retrieve public SSH keys from LDAP.Florian Zschocke2016-11-296-37/+1248
| | | | | | | | | | | | Add new class `LdapPublicKeyManager` which retrieves public SSH keys from LDAP. The attribute can be configured with the new configuration option `realm.ldap.sshPublicKey`. The setting can be a simple attribute name, like `sshPublicKey`, or an attribute name and a prefix for the value, like `altSecurityIdentities:SshKey`, in which case attributes are selected that have the name `altSecurityIdentities` and whose values start with `SshKey:`.
* Extract LdapConnection into new class from LdapAuthProviderFlorian Zschocke2016-11-233-268/+543
| | | | | | | | Extract the inner class `LdapConnection` from the `LdapAuthProvider` into a separate class, so that it can be used from multiple classes that have to connect to an LDAP directory. The new class is placed into the new package `com.gitblit.ldap`, since it isn't specific to authentication.
* Create base unit test class for LDAP tests.Florian Zschocke2016-11-232-332/+416
| | | | | | Extract the creation of the in-memory servers and the interceptor code to a base class that LDAP related unit tests can extend to have the servers available.
* Set "can admin" permission on LDAP users and teams correctlymerged--fixAdminRoleLDAPFlorian Zschocke2016-11-183-19/+296
| | | | | | | | | | | | | | | | | | | | | | | The canAdmin permission is set on a LDAP user, when the user is listed in `realm.ldap.admins` or is a member of a team listed in `realm.ldap.admins`. This leads to inconsistent and surprising behaviour on the EditUser page when clicking the "can admin" checkbox. Also, the "can admin" checkbox is disabled, but not checked, for teams that are listed as admin teams. The new behaviour implemented in this patch makes users and teams from LDAP match local ones. That means: * LDAP teams that are listed in `realm.ldap.admins` get the canAdmin property set if teams are maintained in LDAP. * LDAP users that are listed in `realm.ldap.admins` get the canAdmin property set if teams are maintained in LDAP. * LDAP users do not get the canAdmin property set, if they are only a member of a team listed in `realm.ldap.admins`. * The `supportsRoleChanges` method for users and teams of the `LdapAuthProvider` unconditially returns false if teams are maintained in LDAP, not only for users and teams listed in `realm.ldap.admins`. * Therefore, for all LDAP users and teams the "can admin" checkbox is always disabled if teams are maintained in LDAP.
* Update documentation for LDAP binding in default.properties.merged--fixLDAPbindingFlorian Zschocke2016-11-141-2/+15
| | | | | Extend the comments for some realm.ldap.* properties to better explain use cases and requirements.
* Clean up `LdapAuthProvider` to properly cover different LDAP search scenarios.Florian Zschocke2016-11-111-114/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gitblit allows in its configuration to set a "manager" user (and password) which can be used to search for the entry of a user wanting to log in. If they are both not set, an anonymous search is attempted. In the description below, when I say "...as manager", it is either as manager or anonymous. So far the behaviour of Gitblit, with respect to binding to and searching in LDAP, has been the following when a user logs in: **bind as manager** **search for the user** _bind as the user_ _search for the teams_ I'll call this code flow A. Later an additional configuration option had been added: `realm.ldap.bindpattern`. (PR gitblit/gitblit#162) It was meant to allow for not using a manager nor anonymous binds, by searching the directory as the user logging in. This is done in code flow B: **bind as manager** _bind as user_ _search for user_ _search for teams_ Both A and B are flawed, I think. In A, it looks like a mistake to me that the binding stays with the user after authentication. The problem that this causes is, that in LDAP server configurations where normal users are not allowed to read groups, the team information cannot be retrieved. I tried but failed to understand how B is supposed to work. There will always be a bind request as either anonymous or the manager DN when the LDAP connection is created. If neither is possible, the authentication process will fail and the user cannot log in. When synchronizing users and teams from LDAP, the following code flow is exercised: F: **bind as manager** **search for users** **search for teams** This patch fixes both code flows by introducing a new flow. C: **bind as manager** **search for user** _bind as user to authenticate_ **bind as manager** **search for teams** And it changes code flow B to the following code flow D: _bind as user_ _search for user_ _search for teams_ With code flows A, C, D and F the following usage (and authentication) scenarios are covered. They are described from the view of a Gitblit administrator's intent and his LDAP setup. * Users and team should be snychronized with LDAP This means anonymous or a fixed account must be able to read users and groups. => covered by C and F As the above allows for authentication and is required for synchronisation, all the others below do not cover synchronization. * No anonymous binding allowed and no special manager binding required This means that users must be able to read user an group entries. => covered by D * The user DN needs to be searched, e.g. because they are not all under the same parent DN. This means that anonymous or a fixed account must be able to read users. -- anonymous or the "manager" account can also read groups => covered by C -- anonymous or the "manager" account cannot read groups but a user can => covered by A I therefore believe that the new code will cover all common use cases. The implementation either directly binds as the user, when `bindpattern` is not empty, or it binds anonymous or against the manger DN to search for the user DN entry. If it directly bound against the user DN, the user is already authenticated. It will then only check that the user DN it found in the search is identical to the one it is currently bound against. If it was bound against a manager DN (or anonymously) it will bind against the found user DN to authenticate the user logging in, and will then rebind against the manager DN. When searching for groups in LDAP, if the search fails with a result code other than SUCCESS, the implementation will bind against the user DN, if it isn't already bound against it. It will then repeat the search for groups under the user authorization. This is to keep backwards compatible with the original behaviour A, in order to not break cases where the LDAP setup would deny a manager account to search for groups but allow it for normal users. To achieve this the implementation introduces an internal `LdapConnection` class that wraps the connection and keeps bind state, so that a rebind as a user is possible. This also fixes a resource leak where the connection was not closed in case that the initial bind as the manager account did not succeed. This commit would fix gitblit/gitblit#920
* Extend LDAP tests to use LDAP servers with access restrictions.Florian Zschocke2016-11-091-45/+257
| | | | | | | | | | | | | | Add access restrictions to the LDAP test server instances. New modes used a test parameters are ANONYMOUS, DS_MANAGER and USR_MANAGER. ANONYMOUS can bind anonymously and access users and groups. In DS_MANAGER the server requires authentication and will only allow the DIRECTORY_MANAGER user to search for users and groups. In USR_MANAGER only the user can search groups, the USER_MANAGER, which is used to bind in this mode, can not. A third server instance is created because I did fear side effects should the tests be run in parallel, had I tried to configure the access restriction in Before.
* Extend LDAP authentication tests to use different modes.Florian Zschocke2016-11-061-23/+107
| | | | | | | Instantiate two LDAP servers, one that allows anonymous access, and one that requires authentication for all operations. The JUnit test is parameterized to run all tests with both instances. It uses different settings for each mode.
* Prepare 1.8.0 releasev1.8.0James Moger2016-06-222-10/+10
|
* Update documentation for 1.8.0 releaseJames Moger2016-06-222-96/+37
|
* Merge pull request #1087 from ↵Paul Martin2016-06-191-0/+1
|\ | | | | | | | | mereth/issues/964-session-loss-redirects-to-start-page Fixes #964 - add missing redirect after restoring user in new session
| * add missing redirect after restoring user in new sessionmereth2016-06-151-0/+1
| |
* | Merge pull request #1055 from gitblit/1048-TicketReferencesPaul Martin2016-06-1814-201/+1926
|\ \ | |/ |/| Ticket Reference handling #1048
| * TicketReference Testing #1048Paul Martin2016-06-181-4/+36
| | | | | | | | + Multiple commits in a single push
| * Ticket Reference handling #1048Paul Martin2016-04-2714-201/+1894
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + Supports referencing: + Tickets from other tickets via comments + Tickets from commits on any branch + Common TicketLink class used for both commits and tickets + TicketLink is temporary and persisted to ticket as a Reference + Support deletion of ticket references + Rebasing patchsets/branches will generate new references + Deleting old patchsets/branches will remove the relevant references + Substantial testing of use cases + With and without patchsets, deleting, amending + BranchTicketService used during testing to allow end-to-end ref testing + Relocated common git helper functions to JGitUtils
* | Merge pull request #1084 from metasim/youtrack-hookJames Moger2016-06-132-0/+254
|\ \ | | | | | | Initial implementation of a JetBrains YouTrack hook for GitBlit.
| * | Initial implementation of a JetBrains YouTrack hook for GitBlit.Simeon H.K. Fitch2016-06-032-0/+254
| | |
* | | Merge pull request #1086 from dsteinkopf/masterJames Moger2016-06-131-2/+14
|\ \ \ | | | | | | | | fix baseURL handling in HttpUtils, fixes #1083
| * | | fix baseURL handling in HttpUtils, fixes #1083Dirk Steinkopf2016-06-121-2/+14
|/ / /
* | | Merge pull request #1073 from gitblit/1062-DocEditorUpdatesPaul Martin2016-04-304-29/+36
|\ \ \ | | | | | | | | Fixes #1062 - Upgraded to Prosemirror 0.6.1
| * | | Fixes #1062 - Upgraded to Prosemirror 0.6.1Paul Martin2016-04-294-29/+36
|/ / /
* | | Merge pull request #1070 from gitblit/1061-filestoreSortByDatePaul Martin2016-04-282-3/+48
|\ \ \ | | | | | | | | Fixes #1061 - Most recent first on filestore page
| * | | Fixes #1061 - Most recent first on filestore pagePaul Martin2016-04-282-3/+48
| | |/ | |/|
* / | Use getInteger not getFilesize, fixes #1049James Moger2016-04-201-1/+1
|/ /
* | Merge pull request #1047 from yyjdelete/patch-1Paul Martin2016-04-161-1/+1
|\ \ | | | | | | Use utf-8 for Javadoc
| * | Specify encoding of javadoc to "utf-8"SilverFox2016-04-081-1/+1
| | | | | | | | | | | | That will fix build of javadoc in Windows zh-cn (and maybe some other locale). Unknown why javac works well.
* | | Merge pull request #1060 from gitblit/966-Searching-Always-Over-All-RepositoriesPaul Martin2016-04-161-3/+6
|\ \ \ | | | | | | | | fixes #966 to prevent always searching all repos
| * | | fixes #966 to prevent always searching all reposPaul Martin2016-04-161-3/+6
|/ / /
* | | Merge pull request #1046 from gitblit/1028-FilterAndPagingForFilestorePagePaul Martin2016-04-114-20/+207
|\ \ \ | |/ / |/| | Fixes #1028 - FilestorePage now pages and filters
| * | Fixes #1028 - FilestorePage now pages and filtersPaul Martin2016-04-084-20/+207
|/ /
* | Merge pull request #1039 from gitblit/962-Patchset-Revision-DeletePaul Martin2016-04-067-9/+187
|\ \ | | | | | | Fix for #962 - Delete patchset ability
| * | Fix for #962 - Delete patchset abilityPaul Martin2016-04-067-9/+187
|/ /
* | Merge pull request #1044 from gitblit/1042-IntrusiveFilestoreLozengePaul Martin2016-04-068-48/+17
|\ \ | | | | | | Fix for #1042 - Filestore items now shown as icons
| * | Fix for #1042 - Filestore items now shown as iconsPaul Martin2016-04-068-48/+17
|/ /
* | Merge pull request #1045 from gitblit/882-HonourAllowNewTicketSettingPaul Martin2016-04-061-1/+1
|\ \ | | | | | | Fixes #882 Honour allow new ticket setting
| * | Fixes #882 Honour allow new ticket settingPaul Martin2016-04-061-1/+1
|/ /
* | Merge pull request #1040 from gitblit/1037-EnforcePermissionsForTicketsPaul Martin2016-04-051-5/+13
|\ \ | | | | | | Fix for #1037 myTickets now honours permissions
| * | Fix for #1037 myTickets now honours permissionsPaul Martin2016-04-041-5/+13
|/ /
* | Merge pull request #1035 from gitblit/1034-RepositoryPageLifecyclePaul Martin2016-04-011-8/+10
|\ \ | | | | | | Fix for #1034 Ticket Page Error
| * | Fix for #1034 Ticket Page ErrorPaul Martin2016-03-311-8/+10
|/ /
* | Merge pull request #1022 from gitblit/974-in-browser-doc-editorPaul Martin2016-03-2827-153/+1148
|\ \ | | | | | | Support for editing documents in the browser #974
| * | Friendly URL for EditFile Page #974Paul Martin2016-03-275-13/+37
| | | | | | | | | | | | + Prevent Edit of old doc version
| * | Disable edit links in read only mode #974Paul Martin2016-03-272-5/+21
| | |
| * | Updating ProseMirror to 0.4.0Paul Martin2016-03-272-10/+10
| | |
| * | Document edit capability via ProseMirror submodule #974Paul Martin2016-03-2725-150/+1105
|/ / | | | | | | | | | | | | | | | | | | | | | | + New docEdit page with links from docPage and docList + Bespoke menu system with full screen edit mode + npm required for building client side scripts + Ant script added for BuildUI which performs npm commands + Update font-awesome to 4.5.0 + Factor out to JGitUtils common code in BranchTicketService for EditFilePage + getTreeEntries + commitIndex + Merge capability for document editing
* | Merge pull request #1032 from gitblit/1031-FixForRepositoryPagePaul Martin2016-03-271-2/+10
|\ \ | | | | | | Fix for #1031 to display error message