aboutsummaryrefslogtreecommitdiffstats
path: root/integrations/api_admin_test.go
Commit message (Collapse)AuthorAgeFilesLines
* Add an abstract json layout to make it's easier to change json library (#16528)Lunny Xiao2021-07-241-2/+1
| | | | | | | | | | | * Add an abstract json layout to make it's easier to change json library * Fix import * Fix import sequence * Fix blank lines * Fix blank lines
* Fixed assert statements. (#16089)KN4CK3R2021-06-071-2/+2
|
* Migrate to use jsoniter instead of encoding/json (#14841)zeripath2021-03-011-1/+2
| | | | | | | | | | * Migrate to use jsoniter * fix tests * update gitea.com/go-chi/binding Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* [API] Add Restricted Field to User (#14630)65432021-02-181-0/+14
| | | | | | | | | | | | * Expose Restricted field for User * Add Option to Change Restricted on User via adminEditUser API * Add test who change restricted & test if it changed it ... * make generate-swagger Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* API: Admin EditUser: Make FullName, Email, Website & Location optional (#13562)65432020-11-191-0/+30
| | | | | | | | | * API: Admin EditUser: Make FullName, Email, Website & Location optional * update swagger docs * add Tests Co-authored-by: Lauris BH <lauris@nix.lv>
* Add email validity check (#13475)Chris Shyi2020-11-141-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Improve error feedback for duplicate deploy keys Instead of a generic HTTP 500 error page, a flash message is rendered with the deploy key page template so inform the user that a key with the intended title already exists. * API returns 422 error when key with name exists * Add email validity checking Add email validity checking for the following routes: [Web interface] 1. User registration 2. User creation by admin 3. Adding an email through user settings [API] 1. POST /admin/users 2. PATCH /admin/users/:username 3. POST /user/emails * Add further tests * Add signup email tests * Add email validity check for linking existing account * Address PR comments * Remove unneeded DB session * Move email check to updateUser Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Disable DSA ssh keys by default (#13056)zeripath2020-10-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Disable DSA ssh keys by default OpenSSH has disabled DSA keys since version 7.0 As the docker runs openssh > v7.0 we should just disable DSA keys by default. Refers to #11417 Signed-off-by: Andrew Thornton <art27@cantab.net> * Just disable DSA keys by default Signed-off-by: Andrew Thornton <art27@cantab.net> * Appears we need to set the minimum key sizes too Signed-off-by: Andrew Thornton <art27@cantab.net> * Appears we need to set the minimum key sizes too Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove DSA type * Fix Tests Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix "data race" in testlogger (#9159)zeripath2019-11-261-8/+8
| | | | | | * Fix data race in testlogger * Update git_helper_for_declarative_test.go
* 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
* Fixes #6881 - API users search fix (#6882)Richard Mahn2019-05-081-0/+15
|
* Return a UserList from /api/v1/admin/users (#6629)zeripath2019-04-151-0/+23
|
* Fix #5226 by adding CSRF checking to api reqToken and add CSRF to the POST ↵zeripath2018-11-031-5/+5
| | | | | | | | | | 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
* feat(repo): support search repository by topic name (#4505)Bo-Yi Wu2018-09-131-2/+2
| | | | * feat(repo): support search repository by topic name
* Enforce token on api routes [fixed critical security issue #4357] (#4840)B-OnTheGo2018-09-101-7/+13
|
* Add sudo functionality to the API (#4809)zeripath2018-09-061-0/+29
|
* Delete a user's public key via admin api (closes #3014) (#3059)Vlad Temian2017-12-061-0/+73
* Delete a user's public key via admin api * Test admin ssh endpoint for creating a new ssh key * Adapt public ssh key test to also test the delete operation * Test that deleting a missing key will result in a 404 * Test that a normal user can't delete another user's ssh key * Make DeletePublicKey return err * Update swagger doc