gitea/routers/repo
zeripath 6416f06508
Fix ssh deploy and user key constraints () () ()
Backport of  

1. A key can either be an ssh user key or a deploy key. It cannot be both.
2. If a key is a user key - it can only be associated with one user.
3. If a key is a deploy key - it can be used in multiple repositories and the permissions it has on those repositories can be different.
4. If a repository is deleted, its deploy keys must be deleted too.

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:

- [x] You should not be able to add the same user key as another user
- [x] You should not be able to add a ssh user key which is being used as a deploy key
- [x] You should not be able to add a ssh deploy key which is being used as a user key
- [x] If you add an ssh deploy key to another repository you should be able to use it in different modes without losing the ability to use it in the other mode.
- [x] If you delete a repository you must delete all its deploy keys.

Fix 
2019-02-04 21:41:03 +00:00
..
activity.go Restrict permission check on repositories and fix some problems () 2018-11-28 19:26:14 +08:00
attachment.go Log attachment blocked events () 2018-03-05 08:51:10 +08:00
branch.go branch: Trigger update when deleting branch via UI. () 2019-01-02 20:56:58 +08:00
commit.go fix commit page showing status for current default branch () () 2019-01-06 19:11:49 +01:00
download.go Add raw blob endpoint to get objects by SHA ID () 2018-11-18 13:45:40 -05:00
editor_test.go fix bug on upload file name () 2018-12-20 21:32:11 -05:00
editor.go SECURITY: protect DeleteFilePost et al with cleanUploadFileName () () 2019-01-04 17:41:30 +01:00
http.go Restrict permission check on repositories and fix some problems () 2018-11-28 19:26:14 +08:00
issue_dependency.go Added dependencies for issues () () 2018-07-17 17:23:58 -04:00
issue_label_test.go fix go vet error () 2018-03-30 07:21:27 +08:00
issue_label.go Add label descriptions () 2018-03-13 10:03:55 +08:00
issue_stopwatch.go Handle refactor () 2018-01-10 23:34:17 +02:00
issue_timetrack.go Handle refactor () 2018-01-10 23:34:17 +02:00
issue_watch.go Restrict permission check on repositories and fix some problems () 2018-11-28 19:26:14 +08:00
issue.go Disallow empty titles () () 2019-01-21 17:55:12 +02:00
main_test.go Unit tests for wiki routers () 2017-11-30 17:52:15 +02:00
middlewares.go Add whitespace handling to PR-comparsion () 2018-08-14 13:49:33 -04:00
milestone.go Issue is not overdue when it is on the same date () 2019-01-01 18:56:47 +01:00
pull_review.go Add comment replies () 2018-10-22 16:13:35 -04:00
pull.go Disallow empty titles () () 2019-01-21 17:55:12 +02:00
release_test.go Fix missing branch in release bug () 2017-12-08 13:22:02 +08:00
release.go Restrict permission check on repositories and fix some problems () 2018-11-28 19:26:14 +08:00
repo.go Refactor and simplify redirect to url () 2018-03-15 22:13:34 +01:00
search.go Global code search support () 2018-03-16 22:04:33 +08:00
setting_protected_branch.go Approvals at Branch Protection () 2018-12-11 19:28:37 +08:00
setting.go Fix ssh deploy and user key constraints () () () 2019-02-04 21:41:03 +00:00
settings_test.go An inactive user shouldn't be able to be added as a collaborator () 2018-08-07 13:01:06 +03:00
topic.go Fix topics addition (Another solution) () () 2018-06-21 17:09:46 +08:00
view.go Restrict permission check on repositories and fix some problems () 2018-11-28 19:26:14 +08:00
webhook.go Slack webhook channel name cannot be empty or just contain an hashtag () 2018-09-10 10:31:08 -04:00
wiki_test.go Improve wiki test () 2018-02-13 11:19:49 +02:00
wiki.go Disallow empty titles () () 2019-01-21 17:55:12 +02:00