aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api
Commit message (Collapse)AuthorAgeFilesLines
* Load Issue attributes for API call (#6122)John Olheiser2019-02-191-1/+1
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Refactor issue indexer (#5363)Lunny Xiao2019-02-191-2/+1
|
* Implement "conversation lock" for issue comments (#5073)Lanre Adelowo2019-02-181-0/+6
|
* Allow to set organization visibility (public, internal, private) (#1763)Rémy Boulanouar2019-02-182-0/+9
|
* make sure labels are actually returned (#6053)Lanre Adelowo2019-02-131-0/+5
|
* Fix #5799 - swagger for mergePullRequest (#5996)Thomas Loubiou2019-02-082-0/+6
|
* Add API to list tags (#5850)Lunny Xiao2019-02-074-0/+73
| | | | | | | | | | | | | | * Add API to list tags * update dependency gitea sdk vendor * fix swagger generation * fix swagger * add tests * update code.gitea.io/git vendor
* Expose issue stopwatch toggling via API (#5970)Lanre Adelowo2019-02-062-0/+142
|
* Feature - Pagination for git tree API (#5838)Richard Mahn2019-02-062-18/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Feature - Pagination for git tree API * Handles case when page is negative * Does a for loop over the start and end rather than all entries * Removed redundent logic * Adds per_page as a query parameter * Adds DEFAULT_GIT_TREES_PER_PAGE for settings, ran make fmt * Fix typo in cheat-sheet en * Makes page start at 1, generated swagger * Use updates to SDK * Updates to use latest sdk * Updates swagger for tree api * Adds test for GetTreeBySHA * Updates per PR reviews * Updates per PR reviews * Remove file * Formatting * Fix to swagger file * Fix to swagger * Update v1_json.tmpl * Fix to swagger file
* Fix serving of raw wiki files other than .md (#5814)Gabriel Silva Simões2019-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix serving of raw wiki files other than .md Closes #4690. Closes #4395. Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Simplify code at routers/repo/wiki.go Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Add more files to user2/repo1.wiki for testing Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Update macaron to v1.3.2 Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Add tests for WikiRaw Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Fix NewResponseWriter usage due to macaron update Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Add raw to reserved wiki names Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>
* Add label names as filter in issue search api (#5946)Lanre Adelowo2019-02-041-1/+15
|
* Issue 5924 fix compare button (#5929)zeripath2019-02-031-2/+2
| | | | | | | | | | | | * Revert #5877 This unfortunately was not the solution. Signed-off-by: Andrew Thornton <art27@cantab.net> * Change permission check to create pull requests to CanReadIssuesOrPulls Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix ssh deploy and user key constraints (#1357) (#5939)zeripath2019-02-031-0/+2
| | | | | | | | | | | | | | | | 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
* Add single commit API support (#5843)Lunny Xiao2019-02-023-0/+129
| | | | * add single commit API support
* don't allow pull requests to be created on an archived repository (#5883)Lanre Adelowo2019-01-301-6/+13
| | | | | | * don't allow pull requests to be created on an archived repository Also disable the "PR" button if the repo is archived * Refuse creating an issue/PR via API calls too
* Fix new release creation API to allow empty target (#5870)Lauris BH2019-01-301-0/+4
| | | | | | | | * Fix new release creation API to allow empty target * Add more test cases * Update swagger
* API: Fix null pointer in attempt to Sudo if not logged in (#5872)zeripath2019-01-281-1/+1
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* update swagger for release API pagination (#5841)Lunny Xiao2019-01-251-0/+8
|
* improve the releases api paging (#5831)Lunny Xiao2019-01-241-1/+17
| | | | | | * improve the releases api paging * add max limit on API paging
* Added docs for the tree api (#5834)kolaente2019-01-242-0/+31
| | | | | | | | * Added docs for the tree api * Added missing response definition * Fixed swagger docs
* New API routes added (#5594)Shashvat Kedia2019-01-233-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New API routes added * Comments added * Build fix * swagger_v1_json.tmpl without new line character * Typo fix * Code review changes * Code review changes * Add copyright * Add copyright * Add copyright * Update per @lafriks feedback * Update org.go * Update user.go * Update user.go * make fmt
* Refactor repo.isBare to repo.isEmpty #5629 (#5714)zeripath2019-01-171-1/+1
| | | | | | | | * Refactor repo.isBare to repo.isEmpty #5629 Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove Sync call
* Refactor notification for indexer (#5111)Lunny Xiao2019-01-171-0/+6
| | | | | | * notification for indexer * use NullNotifier as parent struct
* api: Add missing GET teams endpoints (#5382)Harshit Bansal2019-01-162-0/+68
| | | | | | | | | | | | | | | | | | | | * api: Add an endpoint to list a particular member of team. * models: Rename `GetUserTeams()` to `GetUserOrgTeams()` in `org_team` model. `GetUserTeams()` sounds a bit misnomer since it actually returns the teams that user belongs to in a given organization rather than all the teams across all the organization that the user has joined. * models: Add `GetUserTeams()`. Returns all the teams that a user belongs to. * api: Add an endpoint for GET '/user/teams'. A GET request to this endpoint lists all the teams that a user belongs to.
* Issue is not overdue when it is on the same date #5566 (#5568)Rodrigo Villablanca Vásquez2019-01-011-5/+9
| | | | | | | | | | * Due date time of issues and milestones is set to 23:59:59 * Add docs * make gen swagger * fix swagger gen
* Delete organization endpoint added (#5601)Shashvat Kedia2018-12-272-1/+25
| | | | | | | | | | * Delete organization endpoint added * Parameters added in comment * Typo fix * Newline character removed
* Fix route in swagger (#5598)Shashvat Kedia2018-12-261-1/+1
|
* Improve performance of dashboard (#4977)Lunny Xiao2018-12-133-5/+16
|
* fix permission check on api create org (#5523)Lunny Xiao2018-12-111-1/+1
|
* add tests for api user orgs (#5494)Lunny Xiao2018-12-091-1/+1
| | | | | | * add tests for api user orgs * add permission for admin to list user's orgs even he is a private user of org
* admin should be able to delete repos even if he is not a member of the ↵Lanre Adelowo2018-12-021-1/+1
| | | | organization (#5443)
* Removing Labels via EditPullRequest API (#5348)Lucien Kerl2018-12-011-1/+1
| | | | | | | | * added the ability to provide an empty array at the EditPullRequests API to remove all labels Signed-off-by: Lucien Kerl <lucien.kerl@wuerth-it.com> * Update pull.go
* Git-Trees API (#5403)Kasi Reddy2018-11-282-0/+93
| | | | | | | | | | | | * Git-Trees API * update vendor'd libs * added comments to exported function and formatted. * make fmt * update per @lafirks feedback
* Restrict permission check on repositories and fix some problems (#5314)Lunny Xiao2018-11-2814-170/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix units permission problems * fix some bugs and merge LoadUnits to repoAssignment * refactor permission struct and add some copyright heads * remove unused codes * fix routes units check * improve permission check * add unit tests for permission * fix typo * fix tests * fix some routes * fix api permission check * improve permission check * fix some permission check * fix tests * fix tests * improve some permission check * fix some permission check * refactor AccessLevel * fix bug * fix tests * fix tests * fix tests * fix AccessLevel * rename CanAccess * fix tests * fix comment * fix bug * add missing unit for test repos * fix bug * rename some functions * fix routes check
* Implement git refs API for listing references (branches, tags and other) (#5354)Lauris BH2018-11-273-0/+133
| | | | | | | | | | | | | | | | * Inital routes to git refs api * Git refs API implementation * Update swagger * Fix copyright * Make swagger happy add basic test * Fix test * Fix test again :)
* show only opened milestones on issues page milestone filter (#5051)Lanre Adelowo2018-11-261-2/+2
| | | | | | | | | | | | | | * show only opened milestones on issues page milestone filter * update Godoc * update Godoc everywhere * update swagger * use false instead of 0 * Add seccond ordering by ID for milestones where no deadline is set
* API: '/orgs/:org/repos': return private repos with read access (#5310) ↵Daniel Balko2018-11-231-7/+9
| | | | | (#3829) (#5383) Signed-off-by: Daniel Balko <inxonic+github@gmail.com>
* add api for user to create org (#5268)Lunny Xiao2018-11-202-0/+53
| | | | | | | | | | | | | | | | * add api for user to create org * remove unused blank line on the swagger file end * fix create and add test * fix tests * fix routes of create org API * fix bug * add copyright heads
* added the ability to set labels on the "edit pull request" api (#5347)Lucien Kerl2018-11-161-0/+12
| | | Signed-off-by: Lucien Kerl <lucien.kerl@wuerth-it.com>
* Fix create team, update team missing units (#5188)Lunny Xiao2018-11-102-0/+28
|
* Fix #5226 by adding CSRF checking to api reqToken and add CSRF to the POST ↵zeripath2018-11-031-4/+8
| | | | | | | | | | header for deadline (#5250) * Add CSRF checking to reqToken and place CSRF in the post for deadline creation Fixes #5226, #5249 * /api/v1/admin/users routes should have reqToken middleware
* Keys API changes (#4960)zeripath2018-10-313-14/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add private information to the deploy keys api This commit adds more information to the deploy keys to allow for back reference in to the main keys list. It also adds information about the repository that the key is referring to. Signed-off-by: Andrew Thornton <art27@cantab.net> * Add private information to the user keys API This adjusts the keys API to give out private information to user keys if the current user is the owner or an admin. Signed-off-by: Andrew Thornton <art27@cantab.net> * Add ability to search keys by fingerprint This commit adds the functionality to search ssh-keys by fingerprint of the ssh-key. Deploy keys per repository can also be searched. There is no current clear API point to allow search of all deploy keys by fingerprint or keyID. Signed-off-by: Andrew Thornton <art27@cantab.net> * Add integration test
* User action heatmap (#5131)kolaente2018-10-233-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added basic heatmap data * Added extra case for sqlite * Built basic heatmap into user profile * Get contribution data from api & styling * Fixed lint & added extra group by statements for all database types * generated swagger spec * generated swagger spec * generated swagger spec * fixed swagger spec * fmt * Added tests * Added setting to enable/disable user heatmap * Added locale for loading text * Removed UseTiDB * Updated librejs & moment.js * Fixed import order * Fixed heatmap in postgresql * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-Authored-By: kolaente <konrad@kola-entertainments.de> * Added copyright header * Fixed a bug to show the heatmap for the actual user instead of the currently logged in * Added integration test for heatmaps * Added a heatmap on the dashboard * Fixed timestamp parsing * Hide heatmap on mobile * optimized postgresql group by query * Improved sqlite group by statement
* Fix Swagger JSON autogeneration issues. (#4845)zeripath2018-10-2022-22/+121
| | | | | | | | | | | | | | | | | | | | | * Fix Swagger JSON. Remove unnecessary schema references for the forbidden and empty responses Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix swagger API for CreateAccessToken * Fix admin create org swagger * Fix swagger for adminCreateRepo * More swagger fixes Set int64 format for those which are int64 Some more form fixes * Fix swagger description of GET /repos/{owner}/{repo}/pulls
* Remove check for negative length (#5120)Oleg Kovalov2018-10-201-1/+1
|
* Add notification interface and refactor UI notifications (#5085)Lunny Xiao2018-10-183-0/+13
| | | | | | | | * add notification interface and refactor UI notifications * add missing methods on notification interface and notifiy only issue status really changed * implement NotifyPullRequestReview for ui notification
* Add support for search by uid (#4876)zeripath2018-10-181-0/+5
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update Swagger API to match the return of /users/search (#4847)zeripath2018-09-211-1/+10
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* feat(repo): support search repository by topic name (#4505)Bo-Yi Wu2018-09-131-0/+1
| | | | * feat(repo): support search repository by topic name
* Enforce token on api routes [fixed critical security issue #4357] (#4840)B-OnTheGo2018-09-101-1/+1
|