forkjo/modules
David Svantesson 1f951cdeba Add API endpoint for accessing repo topics (#7963)
* Create API endpoints for repo topics.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Generate swagger

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add documentation to functions

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Grammar fix

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix function comment

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Can't use FindTopics when looking for a single repo topic, as it doesnt use exact match

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add PUT ​/repos​/{owner}​/{repo}​/topics and remove GET ​/repos​/{owner}​/{repo}​/topics

* Ignore if topic is sent twice in same request, refactoring.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix topic dropdown with api changes.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Style fix

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Update API documentation

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Better way to handle duplicate topics in slice

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Make response element TopicName an array of strings, instead of using an array of TopicName

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add test cases for API Repo Topics.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix format of tests

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix comments

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix unit tests after adding some more topics to the test fixture.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Update models/topic.go

Limit multiple if else if ...

Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>

* Engine as first parameter in function

Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>

* Replace magic numbers with http status code constants.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix variable scope

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Test one read with login and one with token

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add some more tests

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Apply suggestions from code review

Use empty struct for efficiency

Co-Authored-By: Lauris BH <lauris@nix.lv>

* Add test case to check access for user with write access

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix access, repo admin required to change topics

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Correct first test to be without token

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Any repo reader should be able to access topics.

* No need for string pointer

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
2019-09-03 23:46:24 +08:00
..
auth Abort syncrhonization from LDAP source if there is some error. (#7960) 2019-08-24 21:53:37 +03:00
avatar Improve handling of non-square avatars (#7025) 2019-05-25 14:46:14 +03:00
base Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
cache Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
charset Make encoding tests independent of LOCALE settings (#8018) 2019-09-02 19:08:07 -04:00
context Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
cron Move status table to cron package (#7370) 2019-07-15 20:13:03 -04:00
generate Integrate OAuth2 Provider (#5378) 2019-03-08 11:42:50 -05:00
git Search Commits via Commit Hash (#7400) 2019-09-02 19:38:04 -04:00
gzip Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
highlight Add a lot of extension to language mappings for syntax highlights (#7741) 2019-08-05 23:48:31 +08:00
httplib Add golangci (#6418) 2019-06-12 15:41:28 -04:00
indexer Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
lfs Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
log Removed unnecessary conversions (#7557) 2019-07-23 19:50:39 +01:00
mailer Add golangci (#6418) 2019-06-12 15:41:28 -04:00
markup Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
metrics Prometheus endpoint (#5256) 2018-11-04 22:20:00 -05:00
migrations fix bug when migrating a private repository (#7917) 2019-08-20 21:21:07 +01: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 golangci (#6418) 2019-06-12 15:41:28 -04:00
options Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
pprof Add golangci (#6418) 2019-06-12 15:41:28 -04:00
private Attempt to fix hook problem (#7854) 2019-08-14 12:25:05 +03:00
process Fix run command race (#1470) 2017-11-13 22:51:45 +08:00
public Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
pull Avoid ambiguity of branch/directory names for the git-diff-tree command (#8066) 2019-09-03 15:42:01 +03:00
recaptcha Allow Recaptcha service url to be configured (#6820) 2019-05-02 16:09:39 +03:00
repofiles Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
search Global code search support (#3664) 2018-03-16 22:04:33 +08:00
secret Integrate OAuth2 Provider (#5378) 2019-03-08 11:42:50 -05:00
session Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
setting Add Ability for User to Customize Email Notification Frequency (#7813) 2019-08-29 17:05:42 +03:00
ssh Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
structs Add API endpoint for accessing repo topics (#7963) 2019-09-03 23:46:24 +08:00
sync Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
templates Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
test Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
timeutil Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
upload Fix upload file type check (#7890) 2019-08-17 13:10:17 +03:00
user Add golangci (#6418) 2019-06-12 15:41:28 -04:00
util Display ui time with customize time location (#7792) 2019-08-15 22:46:21 +08:00
validation Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00