summaryrefslogtreecommitdiffstats
path: root/models/gpg_key_test.go
Commit message (Collapse)AuthorAgeFilesLines
* Add option to provide signature for a token to verify key ownership (#14054)zeripath2021-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add option to provide signed token to verify key ownership Currently we will only allow a key to be matched to a user if it matches an activated email address. This PR provides a different mechanism - if the user provides a signature for automatically generated token (based on the timestamp, user creation time, user ID, username and primary email. * Ensure verified keys can act for all active emails for the user * Add code to mark keys as verified * Slight UI adjustments * Slight UI adjustments 2 * Simplify signature verification slightly * fix postgres test * add api routes * handle swapped primary-keys * Verify the no-reply address for verified keys * Only add email addresses that are activated to keys * Fix committer shortcut properly * Restructure gpg_keys.go * Use common Verification Token code Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix individual tests (addition to #15802) (#15818)KN4CK3R2021-05-121-6/+17
| | | | | | | | | | | | | | | | | | | | * Decouple TestAction_GetRepoLink and TestSizedAvatarLink. * Load database for TestCheckGPGUserEmail. * Load database for TestMakeIDsFromAPIAssigneesToAdd. * Load database for TestGetUserIDsByNames and TestGetMaileableUsersByIDs. * Load database for TestUser_ToUser. * Load database for TestRepository_EditWikiPage. * Include AppSubURL in test. * Prevent panic with empty slice. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* chore(models): rewrite code format. (#14754)Bo-Yi Wu2021-03-141-5/+5
| | | | | | | | | | | | | | | * chore: rewrite format. * chore: update format Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * chore: update format Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * chore: Adjacent parameters with the same type should be grouped together * chore: update format.
* Allow addition of gpg keyring with multiple keys (#12487)zeripath2020-08-211-4/+6
| | | | | | | Related #6778 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-151-3/+3
| | | | | | | | | | | | | | | | | | * display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger
* Fix wrong GPG expire date (#6643)Antoine GIRARD2019-04-151-0/+151
| | | | | | * fix expire of gpg relative to key creation https://tools.ietf.org/html/rfc4880#section-5.2.3.6 * add test
* Refactor struct's time to remove unnecessary memory usage (#3142)Lunny Xiao2017-12-111-2/+4
| | | | | | | | | | | | | | * refactor struct's time to remove unnecessary memory usage * use AsTimePtr simple code * fix tests * fix time compare * fix template on gpg * use AddDuration instead of Add
* Fix tests code to prevent some runtime errors (#2381)Morlinest2017-08-281-2/+3
| | | | | | * Fix tests code to prevent some runtime errors * Reduce nesting
* Fix GPG email checking to be case insensitive (#1988)Lauris BH2017-06-171-0/+39
|
* Switch to keybase go-crypto (for some elliptic curve key) + test (#1925)Antoine GIRARD2017-06-141-10/+31
| | | | | | | | | | | | * Switch to keybase go-crypto (for some elliptic curve key) + test * Use assert.NoError and add a little more context to failing test description * Use assert.(No)Error everywhere 🌈 and assert.Error in place of .Nil/.NotNil
* feat: add check misspelling (#1877)Bo-Yi Wu2017-06-051-1/+1
|
* GPG commit validation (#1150)Antoine GIRARD2017-03-221-0/+116
| | | | | | | | | | | | * GPG commit validation * Add translation + some little fix * Move hash calc after retrieving of potential key + missing translation * Add some little test
* Implement GPG api (#710)Antoine GIRARD2017-03-161-0/+48
* Implement GPG API * Better handle error * Apply review recommendation + simplify database operations * Remove useless comments