Permalink
Commits on Nov 18, 2016
  1. Merge pull request #1152 from fzs/fixAdminRoleLDAP

    Set "can admin" permission on LDAP users and teams correctly
    committed on GitHub Nov 18, 2016
  2. Set "can admin" permission on LDAP users and teams correctly

    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.
    fzs committed Nov 18, 2016
Commits on Nov 14, 2016
  1. Merge pull request #1147 from tomaswolf/disabled_pager_links

    Fix disabled links in PagerPanel
    committed on GitHub Nov 14, 2016
  2. Merge pull request #1149 from fzs/fixLDAPbinding

    Fix LDAP binding strategies
    committed on GitHub Nov 14, 2016
  3. Update documentation for LDAP binding in default.properties.

    Extend the comments for some realm.ldap.* properties to better explain
    use cases and requirements.
    fzs committed Nov 14, 2016
Commits on Nov 11, 2016
  1. Clean up `LdapAuthProvider` to properly cover different LDAP search s…

    …cenarios.
    
    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
    fzs committed Nov 11, 2016
Commits on Nov 9, 2016
  1. Extend LDAP tests to use LDAP servers with access restrictions.

    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.
    fzs committed Nov 9, 2016
Commits on Nov 6, 2016
  1. Extend LDAP authentication tests to use different modes.

    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.
    fzs committed Nov 6, 2016
Commits on Oct 31, 2016
  1. Fix disabled links in PagerPanel

    Disabled links in the PagerPanel (used on the LuceneSearchPage to page
    through search results) were only rendered as "disabled". The links
    themselves remained active, which gives strange effects when clicked.
    For instance it was possible to move to result pages -1, -2, and so on.
    
    Really disable the links. Add missing CSS rules to have correct styling
    as Wicket renders disabled links as spans, not anchors. Include the new
    CSS file in BasePage.html. And add the left/right arrows only if not on
    the first/last page.
    tomaswolf committed Oct 31, 2016
Commits on Oct 28, 2016
  1. Merge pull request #1144 from fzs/logSendFailedException

    Improve logging when sending email fails.
    committed on GitHub Oct 28, 2016
  2. Merge pull request #1142 from fzs/merge-strategy

    Merge strategy
    committed on GitHub Oct 28, 2016
  3. Add merge type setting to repository page.

    The merge type is a per repository setting. Add it to the edit page.
    fzs committed with fzs Jun 23, 2014
  4. Add integration strategy to merge tickes fast-forward or with commit.

    Add the option to merge a ticket branch to the integration branch
    only when it can be fast-forwarded, or
    always with a merge commit, or
    by fast-foward if possible, otherwise with a merge commit.
    
    Adds a new property ticket.mergeType with the valid values
    FAST_FOWARD_ONLY, MERGE_ALWAYS and MERGE_IF_NECESSARY.
    
    Merging and canMerge were refactored to make use of a new
    IntegrationStrategy class for each type of strategy.
    fzs committed with fzs Jun 21, 2014
Commits on Oct 27, 2016
  1. Merge pull request #1140 from tomaswolf/issue_1076

    Issue #1076: load commit cache in a background thread
    committed on GitHub Oct 27, 2016
  2. Issue #1076: load commit cache in a background thread

    * Make the CommitCache fully thread-safe. It was using a
      ConcurrentHashMap containing lists, but then handed out these lists.
      It also did multiple operations on that map that as a whole should
      be atomic.
      
    * Use isEmpty() instead of size() == 0.
    
    * Run the loading of the commit cache in a background daemon thread
    tomaswolf committed Oct 26, 2016
Commits on Sep 16, 2016
  1. Merge pull request #1130 from larsmaes/patch-2

    Spelling mistake fix
    committed on GitHub Sep 16, 2016
  2. Spelling mistake fix

    pushedNewBranch was wrongly spelled
    larsmaes committed on GitHub Sep 16, 2016
Commits on Aug 5, 2016
  1. Merge pull request #1110 from WilliamFromTW/master

    1.8.x tranditional chinese translation
    committed on GitHub Aug 5, 2016
Commits on Aug 4, 2016
Commits on Jul 29, 2016
  1. Merge pull request #1105 from guilliamxavier/patch-1

    Fix &rt; to > in mail (in rename status line)
    committed on GitHub Jul 29, 2016
  2. Fix &rt; to > in mail (in rename status line)

    fixes #1104
    guilliamxavier committed on GitHub Jul 29, 2016
Commits on Jun 22, 2016
  1. Prepare 1.8.0 release

    committed Jun 22, 2016
Commits on Jun 19, 2016
  1. Merge pull request #1087 from mereth/issues/964-session-loss-redirect…

    …s-to-start-page
    
    Fixes #964 - add missing redirect after restoring user in new session
    paulsputer committed on GitHub Jun 19, 2016
Commits on Jun 18, 2016
  1. Merge pull request #1055 from gitblit/1048-TicketReferences

    Ticket Reference handling #1048
    paulsputer committed on GitHub Jun 18, 2016
  2. TicketReference Testing #1048

    + Multiple commits in a single push
    paulsputer committed Jun 18, 2016
Commits on Jun 14, 2016
Commits on Jun 13, 2016
  1. Merge pull request #1084 from metasim/youtrack-hook

    Initial implementation of a JetBrains YouTrack hook for GitBlit.
    committed on GitHub Jun 13, 2016
  2. Merge pull request #1086 from dsteinkopf/master

    fix baseURL handling in HttpUtils, fixes #1083
    committed on GitHub Jun 13, 2016
Commits on Jun 12, 2016
Commits on Jun 4, 2016
Commits on Apr 30, 2016
  1. Merge pull request #1073 from gitblit/1062-DocEditorUpdates

    Fixes #1062 - Upgraded to Prosemirror 0.6.1
    paulsputer committed Apr 30, 2016