#3139 Deployment key is not properly given push access
Closed: Fixed Opened by wattersmt.

I've added a deployment key to a project and selected the option to grant PUSH access however the gitolite configuration still only allows read access as shown in ssh. For example:

[puppet-user@server]$ ssh git@pagure.example.com | grep project_name
@R_     project_name

Hi,

Could you please provide:
- the version of Pagure
- the git auth module you're using (gitolite? which version ?)
- The output of grep deploykey_ /srv/git/.gitolite/conf/gitolite.conf
- The output of "ssh git@pagure.example.com" when authenticated with the deploy key

(feel free to replace the names of the project and the hostname, but please keep the rest intact.)

Thanks.

Here you go.

  • the version of Pagure

3.13.1

  • the git auth module you're using (gitolite? which version ?)

We are using gitolite2.

  • The output of grep deploykey_ /srv/git/.gitolite/conf/gitolite.conf

The key does not exist in this file. The configuration file's timestamp also has not changed after adding the key to the project in pagure.

  • The output of "ssh git @pagure.example.com" when authenticated with the deploy key
[mdct-puppeteer-admin@server ]$ ssh -i .ssh/test_key git@mdct-pagure.example.com
PTY allocation request failed on channel 0
hello deploykey_friendlyhello_4, this is gitolite 2.3.1-15.el7 running on git 1.8.3.1
the gitolite config gives you the following access:
    @R_     docs/friendlyhello
    @R_     friendlyhello

The following diff fixes this issue.

--- repo.py.old 2018-04-06 16:35:29.660862618 -0400
+++ repo.py 2018-04-06 16:40:08.398045042 -0400
@@ -1599,7 +1599,7 @@
                 break
         try:
             SESSION.commit()
-            pagure.lib.git.generate_gitolite_acls(project=None)
+            pagure.lib.git.generate_gitolite_acls(project=repo)
             pagure.lib.create_deploykeys_ssh_keys_on_disk(
                 repo,
                 APP.config.get('GITOLITE_KEYDIR', None)
@@ -1729,7 +1729,7 @@
                 user=flask.g.fas_user.username,
             )
             SESSION.commit()
-            pagure.lib.git.generate_gitolite_acls(project=None)
+            pagure.lib.git.generate_gitolite_acls(project=repo)
             pagure.lib.create_deploykeys_ssh_keys_on_disk(
                 repo,
                 APP.config.get('GITOLITE_KEYDIR', None)

This has been fixed in PR #3142.

Metadata Update from @wattersmt:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

Metadata