Commit Graph

18 Commits (b9f5cfddc18c55eee62e1fb64a254fee9782c46c)

Author SHA1 Message Date
Yang Liu b9f5cfddc1
auth: enable authentication by token from password ()
Co-authored-by: Joe Chen <jc@unknwon.io>
2022-10-22 21:25:36 +08:00
Joe Chen 1df62fafb9
db: use `context` and go-mockgen for `ReposStore` () 2022-06-11 12:43:56 +08:00
Joe Chen f837ea6346
db: use `context` and go-mockgen for `UsersStore` () 2022-06-11 09:42:17 +08:00
Joe Chen 7229dd893f
db: use `context` and go-mockgen for `PermsStore` () 2022-06-08 19:26:20 +08:00
Joe Chen fe1d07f29c
db: rename `AccessTokensStore.Save` to `Touch` () 2022-06-08 13:34:10 +08:00
Joe Chen 0a92ad27ef
db: use `context` and go-mockgen for `AccessTokensStore` () 2022-06-06 12:10:36 +08:00
E99p1ant a328e7ccc4
access_token: encrypt access token with SHA256 ()
* access_token: encrypt access token with SHA256

* revert list access token

* fix lint

* generate schemadoc

* add database migrations

* fix tests

* fix tests

* add test case for access token golden

* fix test in postgres

* `Sha256` -> `SHA256`

* Use GORM for migration

* task generate-schemadoc

* Use unique

* change migration name

* allow read

* task generate-schemadoc

* add changelog

* fix lint error

* update changelog

* remove Debug

* add comments

Co-authored-by: Joe Chen <jc@unknwon.io>
2022-06-05 13:34:21 +08:00
deepsource-autofix[bot] e452d94fc8
autofix: format code with gofumpt and gofmt ()
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2022-03-06 17:55:17 +08:00
ᴜɴᴋɴᴡᴏɴ 2eaf1d693a
db: migrate access table to use GORM () 2020-10-06 15:43:28 +08:00
ᴜɴᴋɴᴡᴏɴ ca3330cecd
lfs: ask client to always send the same value for the HTTP header () 2020-10-04 18:40:39 +08:00
ᴜɴᴋɴᴡᴏɴ 3af91d7cfd
auth: decouple types and functions from db () 2020-09-20 11:19:02 +08:00
ᴜɴᴋɴᴡᴏɴ 62dda96159
access_token: migrate to GORM and add tests ()
* access_token: migrate to GORM

* Add tests

* Fix tests

* Fix test clock
2020-04-11 01:25:19 +08:00
ᴜɴᴋɴᴡᴏɴ 9a5b227f3e
lfsutil: add `Storager` interface and local storage ()
* Add Storager interface

* Add tests

* Add back note

* Add tests for basic protocol routes

* Fix lint errors
2020-04-10 22:13:42 +08:00
ᴜɴᴋɴᴡᴏɴ e79aebb3e1
route: bypass require signin check for trigger repo tasks ()
* route: bypass require signin check for trigger repo tasks

* CHANGELOG

* Fix lint errors
2020-04-08 20:55:15 +08:00
ᴜɴᴋɴᴡᴏɴ ee0ea2c5fc
lfs: add unit test for middleware ()
* Add unit test for `authenticate` middleware

* Add more cases

* Add tests for verifyOID and internalServerError

* Add tests for verifyHeader

* Add tests for authroize
2020-04-06 18:35:10 +08:00
ᴜɴᴋɴᴡᴏɴ 07818d5fa5
route: no session for routes without UI ()
Not all routes need session, register session and CSRF middleware as global is a waste of resource, and creating a lot one-time off yet never used session records.
2020-04-05 06:36:08 +08:00
ᴜɴᴋɴᴡᴏɴ 53b91ef306
lfs: run e2e and fix minor issues () 2020-04-05 00:14:22 +08:00
ᴜɴᴋɴᴡᴏɴ 34145c990d
lfs: implement HTTP routes ()
* Bootstrap with GORM

* Fix lint error

* Set conn max lifetime to one minute

* Fallback to use gorm v1

* Define HTTP routes

* Finish authentication

* Save token updated

* Add docstring

* Finish authorization

* serveBatch rundown

* Define types in lfsutil

* Finish Batch

* authutil

* Finish basic

* Formalize response error

* Fix lint errors

* authutil: add tests

* dbutil: add tests

* lfsutil: add tests

* strutil: add tests

* Formalize 401 response
2020-04-04 21:14:15 +08:00