aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api
Commit message (Collapse)AuthorAgeFilesLines
* fix bug user search API pagesize didn't obey ExplorePagingNum (#6579)Lunny Xiao2019-04-111-3/+0
|
* Cleaned permission checks for API -> site admin can now do anything (#6483)Vasek Sraier2019-04-081-29/+40
| | | | | | | | | | | | | | * cleaned permission checks for API -> site admin can now do anything Signed-off-by: Vasek Sraier <git@vakabus.cz> * PR #6483: helper methods moved to context/context.go, added missing return Signed-off-by: Vasek Sraier <git@vakabus.cz> * PR #6483: added documentation to new exported helper functions in context/context.go Signed-off-by: Vasek Sraier <git@vakabus.cz>
* fix upload attachments (#6481)Lunny Xiao2019-04-021-6/+6
| | | | | | | | * fix upload attachments * add migration for new column uploader_id on table attachment * fix imports sequence
* Better logging (#6038) (#6095)zeripath2019-04-022-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Panic don't fatal on create new logger Fixes #5854 Signed-off-by: Andrew Thornton <art27@cantab.net> * partial broken * Update the logging infrastrcture Signed-off-by: Andrew Thornton <art27@cantab.net> * Reset the skip levels for Fatal and Error Signed-off-by: Andrew Thornton <art27@cantab.net> * broken ncsa * More log.Error fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove nal * set log-levels to lowercase * Make console_test test all levels * switch to lowercased levels * OK now working * Fix vetting issues * Fix lint * Fix tests * change default logging to match current gitea * Improve log testing Signed-off-by: Andrew Thornton <art27@cantab.net> * reset error skip levels to 0 * Update documentation and access logger configuration * Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE * Fix broken level caching * Refactor the router log * Add Router logger * Add colorizing options * Adjust router colors * Only create logger if they will be used * update app.ini.sample * rename Attribute ColorAttribute * Change from white to green for function * Set fatal/error levels * Restore initial trace logger * Fix Trace arguments in modules/auth/auth.go * Properly handle XORMLogger * Improve admin/config page * fix fmt * Add auto-compression of old logs * Update error log levels * Remove the unnecessary skip argument from Error, Fatal and Critical * Add stacktrace support * Fix tests * Remove x/sync from vendors? * Add stderr option to console logger * Use filepath.ToSlash to protect against Windows in tests * Remove prefixed underscores from names in colors.go * Remove not implemented database logger This was removed from Gogs on 4 Mar 2016 but left in the configuration since then. * Ensure that log paths are relative to ROOT_PATH * use path.Join * rename jsonConfig to logConfig * Rename "config" to "jsonConfig" to make it clearer * Requested changes * Requested changes: XormLogger * Try to color the windows terminal If successful default to colorizing the console logs * fixup * Colorize initially too * update vendor * Colorize logs on default and remove if this is not a colorizing logger * Fix documentation * fix test * Use go-isatty to detect if on windows we are on msys or cygwin * Fix spelling mistake * Add missing vendors * More changes * Rationalise the ANSI writer protection * Adjust colors on advice from @0x5c * Make Flags a comma separated list * Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING * Ensure matching is done on the non-colored message - to simpify EXPRESSION
* move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)Lunny Xiao2019-03-277-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move code.gitea.io/git to code.gitea.io/gitea/modules/git * fix imports * fix fmt * fix misspell * remove wrong tests data * fix unit tests * fix tests * fix tests * fix tests * fix tests * fix tests * enable Debug to trace the failure tests * fix tests * fix tests * fix tests * fix tests * fix tests * comment commit count tests since git clone depth is 50 * fix tests * update from code.gitea.io/git * revert change to makefile
* Fix Hook & HookList in Swagger (#6432)Segev Finer2019-03-261-2/+2
| | | Signed-off-by: Segev Finer <segev@codeocean.com>
* Updates SDK dep (#6406)Richard Mahn2019-03-221-6/+10
|
* Markdown: enable some more extensions (#6362)Roland Koebler2019-03-211-2/+2
| | | | | | | | | | | | | | * Markdown: enable some more extensions Improve Markdown-rendering by enabling some extensions: - enable definitions lists - enable footnotes - enable header-ids and automatically generate header-ids (for linking to README-sections or creating table-of-contents for larger READMEs) * Markdown: update and exted tests Update and add tests for additionally enabled Markdown-extensions.
* make sure units of a team are returned (#6379)Lanre Adelowo2019-03-191-0/+5
|
* Updates to API 404 responses (#6077)John Olheiser2019-03-1829-91/+91
|
* Return 409 when creating repo if it already exists. (#6330)Bogdan Petrea2019-03-151-2/+3
|
* Copyedit docs (#6275)Aidan Fitzgerald2019-03-092-2/+2
|
* add isAdmin to user model (#6231)Lanre Adelowo2019-03-031-0/+1
| | | | | update vendor and add tests fix swagger
* Adds MustChangePassword to user create/edit API, defaults to true (#6193)John Olheiser2019-02-271-6/+14
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* fix bug when migrate repository 500 when repo is existed (#6188)Lunny Xiao2019-02-261-0/+5
| | | | | | | | * fix bug when migrate repository 500 when repo is existed * use 409 but not 422 for error status code when not exist * translation fix
* Make repo creation for API similar to UI (#6142)John Olheiser2019-02-211-0/+3
|
* Admins can now do unlimited page size user search (listAllUsers & ↵John Olheiser2019-02-211-1/+1
| | | | | listAllOrgs) (#6143) Non-admins will default to 10 page size
* refactor issue indexer, add some testing and fix a bug (#6131)Lunny Xiao2019-02-211-1/+2
| | | | | | | | * refactor issue indexer, add some testing and fix a bug * fix error copyright year on comment header * issues indexer package import keep consistent
* 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