aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* allow api to create tags for releases (#4890)Bobonium2018-09-101-4/+0
|
* Slack webhook channel name cannot be empty or just contain an hashtag (#4786)Lanre Adelowo2018-09-101-3/+11
|
* Fixes repo branch endpoint summary (#4893)Lewis Cowles2018-09-091-1/+1
| | | | | | | in browser saw `/repos/{owner}/{repo}/branches/{branch} List a repository's branches` fixed Addresses https://github.com/go-gitea/debian-packaging/pull/1 Fixes https://github.com/go-gitea/gitea#4892
* Add sudo functionality to the API (#4809)zeripath2018-09-061-1/+44
|
* issues api allow pulls and fix #4832 (#4852)Lunny Xiao2018-09-031-1/+9
|
* API /admin/users/{username} missing parameter (#4775)EnricoFerro2018-08-231-0/+6
|
* Disable merging a WIP Pull request (#4529)Julien Tant2018-08-131-1/+1
| | | | | | | | | | | | | | | | | * prevent pull request to be merged when PR is a WIP * add tests * add helper to prepend WIP: in PR title * move default wip prefixes into settings * use configurable WIP prefixes in javascript and default to first one in templates * add documentation * add unit test on pull model Signed-off-by: Julien Tant <julien@craftyx.fr>
* An inactive user shouldn't be able to be added as a collaborator (#4535)Lanre Adelowo2018-08-071-0/+7
| | | | | | | | | | | | | | * an inactive user shouldn't be able to be a collaborator * use translated error message * add active user check when adding a new collaborator via the api * fix translation text * added collaborator test * improvee testcases
* api: repos/search: add parameters to control the sort order (#3964)Allen Wild2018-08-021-0/+47
| | | | | | | | | | | | | | | | The backend SearchRepositoryByName function supports several sort order options, hook these up to the /repos/search API. New parameters for /repos/search: 'sort': alpha, created, updated, size, or id 'order': asc or desc 'sort' defaults to alpha. 'order' defaults to ascending, and is ignored if 'sort' is not specified. The overall default behavior is unchanged (alphabetically ascending). This partially implements issue #3963 Signed-off-by: Allen Wild <allenwild93@gmail.com>
* Swagger.v1.json template (#3572)Piotr Orzechowski2018-07-282-3/+3
| | | | | | * Turn swagger.v1.json into template * Rename ENABLE_SWAGGER_ENDPOINT option to ENABLE_SWAGGER
* Respect email privacy option in user search via API (#4512)Lanre Adelowo2018-07-251-1/+1
| | | | | | * respect user's email privacy option * make email visible to admin irrespective of privacy option
* Added dependencies for issues (#2196) (#2531)kolaente2018-07-172-0/+14
|
* Issue due date api (#3890)kolaente2018-07-164-1/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implemented basic api endpoint to manage deadlines * Fixed checking for permissions * Updating a deadline from the ui is now entirely done via the api * cleanup * Cosmetics * fixed lint + fmt * Added swagger model definition for deadline response * Updated gitea-sdk * Updated gitea-sdk * More cleanup * Generate swagger json * Merge branch 'master' of https://github.com/go-gitea/gitea into issue-due-date-api # Conflicts: # public/swagger.v1.json * Fixed permission to update a deadline via api * Re-added form to change a deadline * Added client-side validation + not ignore error messages from the api * Added locale for error message * Merge branch 'master' of https://github.com/go-gitea/gitea # Conflicts: # models/issue_comment.go * Proper date validation * Fixed indention * moved css to css file * added documentation for error codes * after merge cleanup * Added swagger description * DO NOTHING BUT TRIGGER THAT F*CKIN CI SO IT PICKS UP THE LATEST COMMIT AS IT SHOULD * DO NOTHING BUT TRIGGER THAT F*CKIN CI SO IT PICKS UP THE LATEST COMMIT AS IT SHOULD * regenerated stylesheets
* Fix query parameter name comment in issue API (#4421)Lauris BH2018-07-121-2/+2
|
* Add ability to delete a token (#4235)techknowlogick2018-07-062-0/+38
| | | Fix #4234
* Fixes repo membership check in API (#4341)Nicolas Da Mutten2018-07-051-1/+1
| | | Untested, since I can't compile (yet).
* Allow administrator to create repository for any organization (#4368)Lauris BH2018-07-051-7/+9
|
* Check that repositories can only be migrated to own user or organizations ↵Lauris BH2018-07-051-8/+15
| | | | | | | | | | (#4366) * Repositories can only migrated to own user or organizations * Add check for organization that user does not belong to * Allow admin to migrate repositories for other users
* Fix milestone appliance and permission checks (#4271)Jonas Franz2018-06-191-9/+17
| | | | | | | | | | | * Fix milestone appliance Fix missing permission check Signed-off-by: Jonas Franz <info@jonasfranz.software> * Fix comment * Add Gitea copyright line
* fix CreateIssueCommentOption reference (#4239)stevegt2018-06-151-1/+1
| | | * fixes a warning remaining from #4010 and #4220
* Fix swagger security parts (#4236)Antoine GIRARD2018-06-121-4/+4
|
* Fix swagger errors (#4220)Antoine GIRARD2018-06-1213-51/+158
| | | | | | | | | | Fix all the resting errors to have a valid swagger file. They are still some warnings but nothing blocking. Doing so I found that some request still misses son parameters for some POST/PUT/PATCH request. This means the a client generated from the swagger file will not work completely. Fix #4088 by activating validation in drone Should fix #4010.
* swagger: add 'required: true' for params in URL (#4097)stevegt2018-06-022-0/+2
| | | | | | | | * Partial fix for #4010 Swagger validation needs 'required: true' for parameters that are in the URL path. Signed-off-by: Steve Traugott <stevegt@t7a.org>
* add simple descriptions for file API responses (#4089)stevegt2018-06-011-3/+6
| | | | | | | | | | * Partial fix for #4010 Swagger needs a description field in each swagger:operation response. Adding minimal text for now on the way to getting swagger validate to pass. Many standard swagger client libraries will not work with gitea until validate passes, so prioritizing that over better descriptions for now. Signed-off-by: Steve Traugott <stevegt@t7a.org>
* add simple descriptions for swagger validate (#4087)stevegt2018-05-317-0/+41
| | | | | | | | | | | * Partial fix for #4010 Swagger needs a comment line above each swagger:response comment -- it uses these to populate the description: fields. Adding minimal text for now on the way to getting swagger validate to pass. Many standard swagger client libraries will not work at all with gitea until validate passes, so prioritizing that over better descriptions for now. Signed-off-by: Steve Traugott <stevegt@t7a.org>
* LDAP Public SSH Keys synchronization (#1844)Magnus Lindvall2018-05-241-1/+1
| | | | | | | | | | | | | | | | | | | * Add LDAP Key Synchronization feature Signed-off-by: Magnus Lindvall <magnus@dnmgns.com> * Add migration: add login source id column for public_key table * Only update keys if needed * Add function to only list pubkey synchronized from ldap * Only list pub ssh keys synchronized from ldap. Do not sort strings as ExistsInSlice does it. * Only get keys belonging to current login source id * Set default login source id to 0 * Some minor cleanup. Add integration tests (updete dep testify)
* Fix some webhooks bugs (#3981)Lunny Xiao2018-05-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | * fix some webhooks bugs * update vendor Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * fix test * fix clearlabels * fix pullrequest webhook bug fix #3492 * update release webhook description * remove unused code * fix push webhook in pull request * small changes
* Add more webhooks support and refactor webhook templates directory (#3929)Lunny Xiao2018-05-162-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | * add more webhook support * move hooks templates to standalone dir and add more webhooks ui * fix tests * update vendor checksum * add more webhook support * move hooks templates to standalone dir and add more webhooks ui * fix tests * update vendor checksum * update vendor Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * load attributes when created release * update comparsion doc
* Multiple assignees (#3705)kolaente2018-05-092-73/+65
|
* fix wrong issue endpoints in swagger doc (#3914)David Schneiderbauer2018-05-082-5/+5
|
* Issue due date (#3794)kolaente2018-05-012-14/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Started adding deadline to ui * Implemented basic issue due date managing * Improved UI for due date managing * Added at least write access to the repo in order to modify issue due dates * Ui improvements * Added issue comments creation when adding/modifying/removing a due date * Show due date in issue list * Added api support for issue due dates * Fixed lint suggestions * Added deadline to sdk * Updated css * Added support for adding/modifiying deadlines for pull requests via api * Fixed comments not created when updating or removing a deadline * update sdk (will do properly once go-gitea/go-sdk#103 is merged) * enhanced updateIssueDeadline * Removed unnessecary Issue.DeadlineString * UI improvements * Small improvments to comment creation + ui & validation improvements * Check if an issue is overdue is now a seperate function * Updated go-sdk with govendor as it was merged * Simplified isOverdue method * removed unessecary deadline to 0 set * Update swagger definitions * Added missing return * Added an explanary comment * Improved updateIssueDeadline method so it'll only update `deadline_unix` * Small changes and improvements * no need to explicitly load the issue when updating a deadline, just use whats already there * small optimisations * Added check if a deadline was modified before updating it * Moved comment creating logic into its own function * Code cleanup for creating deadline comment * locale improvement * When modifying a deadline, the old deadline is saved with the comment * small improvments to xorm session handling when updating an issue deadline + style nitpicks * style nitpicks * Moved checking for if the user has write acces to middleware
* API endpoint for testing webhook (#3550)Ethan Koenig2018-04-294-4/+112
| | | | | | * API endpoint for testing webhook * Empty commit to rerun CI