Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upFix ssh deploy and user key constraints (#1357) #5939
Conversation
This comment has been minimized.
This comment has been minimized.
codecov-io
commented
Feb 2, 2019
•
Codecov Report
@@ Coverage Diff @@
## master #5939 +/- ##
==========================================
+ Coverage 38.54% 38.68% +0.14%
==========================================
Files 330 330
Lines 48526 48573 +47
==========================================
+ Hits 18703 18792 +89
+ Misses 27115 27061 -54
- Partials 2708 2720 +12
Continue to review full report at Codecov.
|
GiteaBot
added
the
lgtm/need 2
label
Feb 2, 2019
zeripath
modified the milestones:
1.7.2,
1.8.0
Feb 2, 2019
zeripath
added
backport/v1.7
kind/bug
labels
Feb 2, 2019
techknowlogick
approved these changes
Feb 3, 2019
Looks great! One nit, but I'm ok if this PR remains same. |
fail("Key access denied", "Deploy key access denied: [key_id: %d, repo_id: %d]", key.ID, repo.ID) | ||
} | ||
|
||
if deployKey.Mode < requestedMode { | ||
fail("Key permission denied", "Cannot push with deployment key: %d to repo_id: %d", key.ID, repo.ID) |
This comment has been minimized.
This comment has been minimized.
techknowlogick
Feb 3, 2019
Member
One tiny nit: I know this was the error message before your change, but could you update it to include something about this specific deploy key being read-only?
GiteaBot
added
lgtm/need 1
and removed
lgtm/need 2
labels
Feb 3, 2019
This comment has been minimized.
This comment has been minimized.
The deploykey should be deleted from public_key table if last repo which use it is deleted? |
This comment has been minimized.
This comment has been minimized.
Hi @lunny the call to deleteDeployKey manages the deletion of the PublicKey entry as necessary. |
zeripath
added some commits
Feb 2, 2019
zeripath
force-pushed the
zeripath:issue-1357-fix-deploy-keys-semantics
branch
from
01a9fad
to
d2e9331
Feb 3, 2019
This comment has been minimized.
This comment has been minimized.
OK I've added some tests and changed the failure message as per @techknowlogick If you look at the tests - I've created them in a more declarative style similar to that of TestGit. |
lafriks
approved these changes
Feb 3, 2019
GiteaBot
added
lgtm/done
and removed
lgtm/need 1
labels
Feb 3, 2019
zeripath
merged commit 01c10a9
into
go-gitea:master
Feb 3, 2019
2 checks passed
zeripath
deleted the
zeripath:issue-1357-fix-deploy-keys-semantics
branch
Feb 3, 2019
This comment has been minimized.
This comment has been minimized.
please backport to release/v1.7 |
zeripath commentedFeb 2, 2019
My understanding is that the intention is:
We currently don't enforce any of this and multiple repositories access with different permissions doesn't work at all. This PR enforces the following constraints:
Fix #1357