summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/hook.go
Commit message (Collapse)AuthorAgeFilesLines
* Renamed ctx.User to ctx.Doer. (#19161)KN4CK3R2022-03-221-2/+2
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Move accessmode into models/perm (#17828)Lunny Xiao2021-11-281-4/+4
|
* Move webhook into models/webhook/ (#17579)Lunny Xiao2021-11-101-7/+8
|
* [API] generalize list header (#16551)65432021-08-121-2/+15
| | | | | | | | | | | | | * Add info about list endpoints to CONTRIBUTING.md * Let all list endpoints return X-Total-Count header * Add TODOs for GetCombinedCommitStatusByRef * Fix models/issue_stopwatch.go * Rrefactor models.ListDeployKeys * Introduce helper func and use them for SetLinkHeader related func
* Implemented head_commit for webhooks (#16282)KN4CK3R2021-06-291-9/+10
| | | | | | | * Removed Len field. * Added head_commit webhook field. * Added comment for returns.
* [refactor] Unify the export of user data via API (#15144)65432021-03-271-2/+2
| | | | | * [refactor] unify how user data is exported via API * test time via unix timestamp
* Move macaron to chi (#14293)Lunny Xiao2021-01-261-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use [chi](https://github.com/go-chi/chi) instead of the forked [macaron](https://gitea.com/macaron/macaron). Since macaron and chi have conflicts with session share, this big PR becomes a have-to thing. According my previous idea, we can replace macaron step by step but I'm wrong. :( Below is a list of big changes on this PR. - [x] Define `context.ResponseWriter` interface with an implementation `context.Response`. - [x] Use chi instead of macaron, and also a customize `Route` to wrap chi so that the router usage is similar as before. - [x] Create different routers for `web`, `api`, `internal` and `install` so that the codes will be more clear and no magic . - [x] Use https://github.com/unrolled/render instead of macaron's internal render - [x] Use https://github.com/NYTimes/gziphandler instead of https://gitea.com/macaron/gzip - [x] Use https://gitea.com/go-chi/session which is a modified version of https://gitea.com/macaron/session and removed `nodb` support since it will not be maintained. **BREAK** - [x] Use https://gitea.com/go-chi/captcha which is a modified version of https://gitea.com/macaron/captcha - [x] Use https://gitea.com/go-chi/cache which is a modified version of https://gitea.com/macaron/cache - [x] Use https://gitea.com/go-chi/binding which is a modified version of https://gitea.com/macaron/binding - [x] Use https://github.com/go-chi/cors instead of https://gitea.com/macaron/cors - [x] Dropped https://gitea.com/macaron/i18n and make a new one in `code.gitea.io/gitea/modules/translation` - [x] Move validation form structs from `code.gitea.io/gitea/modules/auth` to `code.gitea.io/gitea/modules/forms` to avoid dependency cycle. - [x] Removed macaron log service because it's not need any more. **BREAK** - [x] All form structs have to be get by `web.GetForm(ctx)` in the route function but not as a function parameter on routes definition. - [x] Move Git HTTP protocol implementation to use routers directly. - [x] Fix the problem that chi routes don't support trailing slash but macaron did. - [x] `/api/v1/swagger` now will be redirect to `/api/swagger` but not render directly so that `APIContext` will not create a html render. Notices: - Chi router don't support request with trailing slash - Integration test `TestUserHeatmap` maybe mysql version related. It's failed on my macOS(mysql 5.7.29 installed via brew) but succeed on CI. Co-authored-by: 6543 <6543@obermui.de>
* Move webhook type from int to string (#13664)Lunny Xiao2020-12-081-1/+1
| | | | | | | | | | | | | | * Move webhook type from int to string * rename webhook_services * finish refactor * Fix merge * Ignore unnecessary ci Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Move Repo APIFormat to convert package (#13787)65432020-12-021-1/+1
| | | | | * Move Repo APIFormat to convert package * tweek
* Refactor: move Commit To APIFormat Code & Lot of StopWatch related things ↵65432020-09-181-1/+1
| | | | | | | | | | | | | (#12729) * move GitCommit to APIFormat convertion into convert package * rename Commit convert functions * move stopwatch to api convertion into convert package & rm unused code & extend test * fix compare time * Gitea not Gogs ;)
* Remove page size limit comment from swagger (#11806)Cirno the Strongest2020-06-091-1/+1
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* API add/generalize pagination (#9452)SpaWn2KiLl2020-01-241-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * paginate results * fixed deadlock * prevented breaking change * updated swagger * go fmt * fixed find topic * go mod tidy * go mod vendor with go1.13.5 * fixed repo find topics * fixed unit test * added Limit method to Engine struct; use engine variable when provided; fixed gitignore * use ItemsPerPage for default pagesize; fix GetWatchers, getOrgUsersByOrgID and GetStargazers; fix GetAllCommits headers; reverted some changed behaviors * set Page value on Home route * improved memory allocations * fixed response headers * removed logfiles * fixed import order * import order * improved swagger * added function to get models.ListOptions from context * removed pagesize diff on unit test * fixed imports * removed unnecessary struct field * fixed go fmt * scoped PR * code improvements * code improvements * go mod tidy * fixed import order * fixed commit statuses session * fixed files headers * fixed headers; added pagination for notifications * go mod tidy * go fmt * removed Private from user search options; added setting.UI.IssuePagingNum as default valeu on repo's issues list * Apply suggestions from code review Co-Authored-By: 6543 <6543@obermui.de> Co-Authored-By: zeripath <art27@cantab.net> * fixed build error * CI.restart() * fixed merge conflicts resolve * fixed conflicts resolve * improved FindTrackedTimesOptions.ToOptions() method * added backwards compatibility on ListReleases request; fixed issue tracked time ToSession * fixed build error; fixed swagger template * fixed swagger template * fixed ListReleases backwards compatibility * added page to user search route Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Swagger info corrections (#9441)65432019-12-201-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * use numbers and not http.Status___ enum * fix test * add many missing swagger responses * code format * Deletion Sould return 204 ... * error handling improvements * if special error type ... then add it to swagger too * one smal nit * invalidTopicsError is []string * valid swagger specification 2.0 - if you add responses swagger can tell you if you do it right :+1: * use ctx.InternalServerError * Revert "use numbers and not http.Status___ enum" This reverts commit b1ff386e2418ed6a7f183e756b13277d701278ef. * use http.Status* enum everywhere
* Move code.gitea.io/gitea/routers/api/v1/convert to ↵Lunny Xiao2019-11-101-1/+1
| | | | | | | | code.gitea.io/gitea/modules/convert (#8892) * Move code.gitea.io/gitea/routers/api/v1/convert to code.gitea.io/gitea/modules/convert * fix fmt
* Rename HookQueue to hookQueue (#8778)Lunny Xiao2019-11-021-1/+1
| | | | | | * Rename HookQueue to hookQueue * fix lint
* Move webhook to a standalone package under modules (#8747)Lunny Xiao2019-11-011-2/+3
| | | | | | | | * Move webhook to a standalone package under modules * fix test * fix comments
* fix wrong email when use gitea as OAuth2 provider (#7640)renothing2019-07-271-2/+2
| | | | | | | when you use gitea as OAuth2 provider, the /api/v1/user should return user primary email as identifier, which is unique in OAuth2 clients. this patch use convert.ToUser replace all u.APIFormat in api requests, return primary email when caller is yourself or admin.
* Move sdk structs to modules/structs (#6905)Lunny Xiao2019-05-111-1/+1
| | | | | | | | | | | | * move sdk structs to moduels/structs * fix tests * fix fmt * fix swagger * fix vendor
* move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)Lunny Xiao2019-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Updates to API 404 responses (#6077)John Olheiser2019-03-181-1/+1
|
* Fix Swagger JSON autogeneration issues. (#4845)zeripath2018-10-201-0/+4
| | | | | | | | | | | | | | | | | | | | | * 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
* Fix swagger errors (#4220)Antoine GIRARD2018-06-121-1/+6
| | | | | | | | | | 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.
* API endpoint for testing webhook (#3550)Ethan Koenig2018-04-291-1/+57
| | | | | | * API endpoint for testing webhook * Empty commit to rerun CI
* refactor: import order. (#3736)Bo-Yi Wu2018-03-291-2/+2
|
* Fix API status code for hook creation (#2814)Ethan Koenig2017-11-201-1/+1
| | | | | | * Fix API status code for hook creation * Named constants for response statuses
* Update swagger documentation (#2899)Ethan Koenig2017-11-131-42/+117
| | | | | | | | | | | * Update swagger documentation Add docs for missing endpoints Add documentation for request parameters Make parameter naming consistent Fix response documentation * Restore delete comments
* Improve swagger doc (#2274)Antoine GIRARD2017-08-211-7/+7
| | | | | | | | | | | | | | | | | | | | * Add swagger comment for adminCreateOrg * Add swagger comment for admin route * add hook swagger doc * Add tags * Add auth * Fix name of responses * Edit name method * Update vendor * make generate-swagger
* Generate swagger json (#1402)Antoine GIRARD2017-05-021-3/+42
| | | | | | | - Generate swagger.json into public/ - Add swagger-ui auto-installation - Add footer link to local swagger-ui - Add /swagger url for using app url. - Fix Swagger-UI version via git tag
* Bug fixes for webhook API (#650)Ethan Koenig2017-01-141-2/+5
|
* Organization webhook API endpointsEthan Koenig2016-12-251-133/+15
|
* Bug fix for edit-hook API endpointEthan Koenig2016-12-091-2/+8
|
* golint fixed for routers (#208)Lunny Xiao2016-11-241-3/+7
|
* Fix import path of go-sdk (#141)Sandro Santilli2016-11-111-1/+1
| | | | From code.gitea.io/go-sdk/gitea To code.gitea.io/sdk/gitea
* Update import paths from github.com/go-gitea to code.gitea.io (#135)Sandro Santilli2016-11-101-4/+4
| | | | | | | - Update import paths from github.com/go-gitea to code.gitea.io - Fix import path for travis See https://docs.travis-ci.com/user/languages/go#Go-Import-Path
* Use MixedCase constant namesSandro Santilli2016-11-071-6/+6
| | | | See https://github.com/golang/go/wiki/CodeReviewComments#mixed-caps
* Replaced go-gogs-client with go-sdk importsThomas Boerger2016-11-071-1/+1
|
* Change import reference to match gitea instead of gogs (#37)Rémy Boulanouar2016-11-031-3/+3
|
* added support to set pull_request event from api (#3513)Kurt Madel2016-08-241-2/+4
|
* models/webhook: restrict deletion to be explicitly with repo and org IDUnknwon2016-07-171-9/+9
|
* api: delete repository webhooks (#3275)Dennis Chen2016-07-171-0/+9
| | | | | | | | Allows the deletion of a webhook from a repository at the /:user/:repo/hooks/:id endpoint. Solves drone/drone issue #1603. Signed-off-by: Dennis Chen <barracks510@gmail.com>
* #3274 fix can't get webhook detail of organizationUnknwon2016-07-161-1/+1
|
* #3057 retrieve webhook with repo_idUnknwon2016-07-081-1/+1
| | | | | This prevents user retrieve arbitrary webhook by changing URL to access webhook from other unauthorized repositories.
* #1692 api: admin list and create team under organizationUnknwon2016-03-211-0/+164