Deploy keys created by user removed from private group will not work any more
Summary
Deploy keys with write access cannot push to repository if their creator was removed from the private project.
Steps to reproduce
- Create a private group with Alice as owner
- Create a private project in the group
- Log in as Alice, add a deploy key to the project, enable write access for the key
- Try to push to the repository with the deploy key (success)
- Still logged in as Alice, add Bob to the group as owner
- Now log in as Bob, remove Alice from the group
- Try to push to the repository with the same deploy key
Example Project
Since it requires private project not sure if it's helpful here, but here you go: deploy-keys-test/test
What is the current bug behavior?
git push origin test outputs the following:
remote: GitLab: The project you were looking for could not be found.
To gitlab.com:deploy-keys-test/test.git
! [remote rejected] test -> test (pre-receive hook declined)
error: failed to push some refs to 'git@gitlab.com:deploy-keys-test/test.git'
What is the expected correct behavior?
git push origin test should succeed without error.
Relevant logs and/or screenshots
ssh git@gitlab.com outputs the following:
Welcome to GitLab, @Alice!
Output of checks
This bug happens on GitLab.com
Edited by 🤖 GitLab Bot 🤖