That would work, but also would increase hook run time running extra API calls searching to make a match. I was able to review gitolite and gitlab-shell code and make a minor change to gitlab-shell code to make the user name available in the hook's shell environment like gitolite does (gitlab-shell already determines username, for some reason just doesn't share it with the env/hooks).
Thanks for your response. On Wed, March 12, 2014 5:05 pm, Mike Lee wrote: > You can use the Gitlab API to get all the users > > curl > "https://gitlab.company.com/api/v3/users?private_token=XXXX&per_page=100" > > and for each user sudo with the user id to get the ssh key > > curl > "https://gitlab.company.com/api/v3/user/keys?private_token=XXXX&sudo=11" > > matching the key id with the GL_ID number. > > > On Tuesday, November 12, 2013 8:54:56 AM UTC-8, GitLab List wrote: >> >> >> The hook environment has a variable set, for example: >> >> GL_ID=key-3 >> >> The 3 in this case would map to a ssh id in gitlab that can be queried via >> the >> gitlab API. >> >> Is there any way to obtain the actual gitlab user id from this GL_ID info? >> >> Thanks. >> >> On Tue, November 12, 2013 9:21 am, GitLab List wrote: >> > >> > Is there any way for the git hooks to obtain the gitlab id of the >> reference >> > pusher? >> > >> > In gitolite, the shell set env vars the hooks can read to obtain the id >> of the >> > account pushing to the server based on their ssh identity. >> > >> > We need to be able to id the account that pushed the reference to the >> server >> > for things such as auditing who pushed which commits and to managed >> reference >> > control, in finer granularity than all or nothing for >> creating/deleting/moving >> > various references. We already have this working with gitolite. >> > >> > We are looking to replace gitolite with gitlab, but need to have >> reliable >> > traceability as to who put what on the server. >> > >> > Thanks. >> > >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "GitLab" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to [email protected] <javascript:>. >> > For more options, visit https://groups.google.com/groups/opt_out. >> > >> > >> > >> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "GitLab" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "GitLab" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
