gitea/modules
zeripath 6416f06508
Fix ssh deploy and user key constraints (#1357) (#5939) (#5966)
Backport of #5939 

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 #1357
2019-02-04 21:41:03 +00:00
..
auth Request for public keys only if LDAP attribute is set (#5816) (#5819) 2019-01-24 12:21:36 +02:00
avatar Use assert in legacy unit tests (#867) 2017-02-08 14:29:07 +08:00
base Serve audio files using HTML5 audio tag (#5221) 2018-10-30 10:17:26 +08:00
cache Fix memcache support when value is returned as string always (#2924) 2017-11-16 15:06:34 +08:00
context Fix go-get URL generation (#5905) (#5907) 2019-01-30 23:29:44 +02:00
cron Add branch overiew page (#2108) 2017-10-26 08:49:16 +08:00
generate Implements generator cli for secrets (#3531) 2018-02-18 20:14:37 +02:00
highlight No highlighting for .txt files (#1922) 2017-06-09 19:39:16 -05:00
httplib Add sensitive headers (#3429) 2018-01-31 00:09:16 +02:00
indexer fix indexer reindex bug when gitea restart (#5563) 2018-12-19 16:37:48 +08:00
lfs Fix bug when read public repo lfs file (#5913) 2019-01-31 13:36:10 +00:00
log Remove maxlines option for file logger (#5282) 2018-11-07 06:48:53 +02:00
mailer Explicitly decide whether to use TLS in mailer's configuration (#5024) 2018-11-26 14:21:41 -05:00
markup support envs on external render commands (#5278) 2018-11-20 17:11:21 -05:00
metrics Prometheus endpoint (#5256) 2018-11-04 22:20:00 -05:00
minwinsvc Fix Git hooks not being executed on Windows when running as a service (#1149) 2017-03-09 09:27:43 +08:00
notification Add notification interface and refactor UI notifications (#5085) 2018-10-18 19:23:05 +08:00
options Fix typos in models/ and modules/ (#1248) 2017-03-15 08:52:01 +08:00
pprof cmd/serve: pprof cpu and memory profile dumps to disk (#4560) 2018-08-07 14:49:18 -04:00
private Fix ssh deploy and user key constraints (#1357) (#5939) (#5966) 2019-02-04 21:41:03 +00:00
process Fix run command race (#1470) 2017-11-13 22:51:45 +08:00
public When redirecting clean the path to avoid redirecting to //www.othersite.com (#5669) (#5679) 2019-01-09 17:32:49 -05:00
recaptcha Add Recaptcha functionality to Gitea (#4044) 2018-07-05 00:13:05 -04:00
search Global code search support (#3664) 2018-03-16 22:04:33 +08:00
setting fix lfs version check warning log when using ssh protocol (#5501) 2018-12-19 09:17:43 +08:00
ssh Configurable SSH key exchange algorithm and MAC suite (#2806) 2017-11-02 23:26:41 +08:00
sync Fix status table race condition (#1835) 2017-05-31 16:57:17 +08:00
templates Create Progressive Web App (#4730) 2018-11-27 10:18:26 -05:00
test Restrict permission check on repositories and fix some problems (#5314) 2018-11-28 19:26:14 +08:00
user Remove check for negative length (#5120) 2018-10-20 17:25:14 -04:00
util Disallow empty titles (#5785) (#5794) 2019-01-21 17:55:12 +02:00
validation Improve URL validation for external wiki and external issues (#4710) 2018-08-15 09:29:37 +03:00