Commit Graph

130 Commits

Author SHA1 Message Date
Derrick Hammer 9e52cd671b
refactor: standardize errors to global error objects 2023-06-09 06:24:42 -04:00
Derrick Hammer d1d4f6b679
refactor: try to decode the token claim for pre-verification 2023-06-09 04:29:18 -04:00
Derrick Hammer 16f2ac3604
refactor: verify the token is a valid format, then check the db, then validate, and if it fails, delete from the db 2023-06-09 04:26:50 -04:00
Derrick Hammer f941ee46d4
fix: we can't use AddHandler inside BeginRequest 2023-06-09 04:16:58 -04:00
Derrick Hammer e98e2d0c89
refactor: add jwt auth middleware to files controller 2023-06-09 04:06:03 -04:00
Derrick Hammer 34be432af7
refactor: use controller base class 2023-06-09 04:05:19 -04:00
Derrick Hammer 73e1c5a363
refactor: move all primary logic to service packages and standardize error objects 2023-06-09 04:03:29 -04:00
Derrick Hammer d18be0acc8
refactor: move error helpers to controller.go 2023-06-07 13:17:49 -04:00
Derrick Hammer 98fd2a097e
refactor: move more response structs to response package 2023-06-07 13:17:11 -04:00
Derrick Hammer cfa7ceb2f4
fix: output error info 2023-06-07 13:12:37 -04:00
Derrick Hammer 2f7c31d53c
refactor: completely restructure validation. split request and respond structs to their own package 2023-06-07 13:04:38 -04:00
Derrick Hammer bfbf13a57d
refactor: use tryParseRequest 2023-06-07 08:50:29 -04:00
Derrick Hammer 9d843bffdb
refactor: use tryParseRequest 2023-06-07 08:49:07 -04:00
Derrick Hammer f3e43f522f
refactor: add validation for all auth request structs 2023-06-06 23:28:33 -04:00
Derrick Hammer dd8e5704c8
refactor: rename checkPubkey to CheckPubkeyValidator 2023-06-06 23:27:43 -04:00
Derrick Hammer 9bacd95c9d
refactor: move to ozzo-validation 2023-06-06 23:16:34 -04:00
Derrick Hammer 27e7ea7d7a
fix: PostPubkeyLogin should not preload any model 2023-06-06 22:28:58 -04:00
Derrick Hammer 09d53ffa76
fix: PostPubkeyLogin should be lowercasing the pubkey and signature 2023-06-06 22:28:40 -04:00
Derrick Hammer d680f0660f
fix: PostPubkeyChallenge should be lowercasing the pubkey for consistency 2023-06-06 22:28:17 -04:00
Derrick Hammer 36745bb55b
fix: PostPubkeyChallenge should be using ChallengeRequest 2023-06-06 22:27:34 -04:00
Derrick Hammer db3ba1f014
fix: PostPubkeyChallenge should not be checking email, but pubkey 2023-06-06 22:27:07 -04:00
Derrick Hammer c20dec0204
fix: abort if we don't have a password for the account, assume its pubkey only 2023-06-06 22:05:49 -04:00
Derrick Hammer def1b50cfc
fix: ensure we store the pubkey in lowercase 2023-06-06 22:04:59 -04:00
Derrick Hammer f3172b0d31
fix: handle duplicate tus uploads by hash 2023-06-06 17:25:29 -04:00
Derrick Hammer f8aaeff6de
fix: rewrite gorm query logic for tus uploads 2023-06-06 17:01:54 -04:00
Derrick Hammer 99d7b8347a
feat: add debug mode logging support 2023-06-06 16:37:22 -04:00
Derrick Hammer 670bc9d64c
refactor: enable automatic env parsing 2023-06-06 16:35:58 -04:00
Derrick Hammer 4831b8b68f
refactor: need to add renterd-api-password config arg 2023-06-06 16:35:20 -04:00
Derrick Hammer 38b76155af
feat: add a status endpoint and move cid validation to a utility method 2023-06-06 16:34:05 -04:00
Derrick Hammer 1f195cf328
feat: add a Status method for uploads 2023-06-06 16:33:14 -04:00
Derrick Hammer d0e59c8729
refactor: no longer embed renterd 2023-06-06 16:32:27 -04:00
Derrick Hammer 72255eb3c5
fix: newer gorm version causes db rebuilds every boot 2023-06-02 04:48:46 -04:00
Derrick Hammer 8331136f7f
chore: update renterd 2023-05-31 19:28:24 -04:00
Derrick Hammer 325ab7044f
refactor: sync cli options and env code with upstream 2023-05-31 00:17:02 -04:00
Derrick Hammer d1742265b6
chore: update renterd 2023-05-31 00:15:36 -04:00
Derrick Hammer 09cd274d29
chore: update renterd 2023-05-29 13:06:32 -04:00
Derrick Hammer 26042b62ac
fix: Use gorm save, and return nil if successful 2023-05-23 20:16:26 -04:00
Derrick Hammer 038d2c440b
fix: save upload info after every chunk 2023-05-23 20:15:49 -04:00
Derrick Hammer 96ac75bf3f
refactor: add logging 2023-05-23 20:15:24 -04:00
Derrick Hammer 56d61895f5
refactor: pass id to FileInfo and use info in fileUpload 2023-05-23 20:15:08 -04:00
Derrick Hammer 89ef950432
refactor: use provided file hash 2023-05-23 20:14:21 -04:00
Derrick Hammer 396b3f60a8
refactor: move terminateUpload db logic to store 2023-05-23 20:12:48 -04:00
Derrick Hammer e7d1bd0f09
refactor: add getStore helper 2023-05-23 20:10:51 -04:00
Derrick Hammer e8c232dfdd
refactor: change shared to use interfaces to avoid an import cycle 2023-05-23 20:10:17 -04:00
Derrick Hammer 39936b3b14
refactor: create a new tus store that uses the db for meta instead of the filesystem 2023-05-22 19:07:06 -04:00
Derrick Hammer 7845f95776
refactor: move logger to its own package 2023-05-22 19:05:53 -04:00
Derrick Hammer 6d5b9d880b
refactor: deduplicate building api urls 2023-05-22 17:14:32 -04:00
Derrick Hammer 4b712a3a80
refactor: see if proof exists and only if both the proof and file are not 404, do we abort as already existing 2023-05-22 16:36:19 -04:00
Derrick Hammer 7fe05862b1
chore: update renterd 2023-05-22 11:02:59 -04:00
Derrick Hammer 90170e5b81
fix: if we have an existing upload, just return it as if successful 2023-05-22 11:02:47 -04:00