mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-04 14:46:57 -05:00
5d2e11eedb
`models` does far too much. In particular it handles all `UserSignin`. It shouldn't be responsible for calling LDAP, SMTP or PAM for signing in. Therefore we should move this code out of `models`. This code has to depend on `models` - therefore it belongs in `services`. There is a package in `services` called `auth` and clearly this functionality belongs in there. Plan: - [x] Change `auth.Auth` to `auth.Method` - as they represent methods of authentication. - [x] Move `models.UserSignIn` into `auth` - [x] Move `models.ExternalUserLogin` - [x] Move most of the `LoginVia*` methods to `auth` or subpackages - [x] Move Resynchronize functionality to `auth` - Involved some restructuring of `models/ssh_key.go` to reduce the size of this massive file and simplify its files. - [x] Move the rest of the LDAP functionality in to the ldap subpackage - [x] Re-factor the login sources to express an interfaces `auth.Source`? - I've done this through some smaller interfaces Authenticator and Synchronizable - which would allow us to extend things in future - [x] Now LDAP is out of models - need to think about modules/auth/ldap and I think all of that functionality might just be moveable - [x] Similarly a lot Oauth2 functionality need not be in models too and should be moved to services/auth/source/oauth2 - [x] modules/auth/oauth2/oauth2.go uses xorm... This is naughty - probably need to move this into models. - [x] models/oauth2.go - mostly should be in modules/auth/oauth2 or services/auth/source/oauth2 - [x] More simplifications of login_source.go may need to be done - Allow wiring in of notify registration - *this can now easily be done - but I think we should do it in another PR* - see #16178 - More refactors...? - OpenID should probably become an auth Method but I think that can be left for another PR - Methods should also probably be cleaned up - again another PR I think. - SSPI still needs more refactors.* Rename auth.Auth auth.Method * Restructure ssh_key.go - move functions from models/user.go that relate to ssh_key to ssh_key - split ssh_key.go to try create clearer function domains for allow for future refactors here. Signed-off-by: Andrew Thornton <art27@cantab.net> |
||
---|---|---|
.. | ||
fixtures | ||
migrations_test.go | ||
migrations.go | ||
testlogger_test.go | ||
v70.go | ||
v71.go | ||
v72.go | ||
v73.go | ||
v74.go | ||
v75.go | ||
v76.go | ||
v77.go | ||
v78.go | ||
v79.go | ||
v80.go | ||
v81.go | ||
v82.go | ||
v83.go | ||
v84.go | ||
v85.go | ||
v86.go | ||
v87.go | ||
v88.go | ||
v89.go | ||
v90.go | ||
v91.go | ||
v92.go | ||
v93.go | ||
v94.go | ||
v95.go | ||
v96.go | ||
v97.go | ||
v98.go | ||
v99.go | ||
v100.go | ||
v101.go | ||
v102.go | ||
v103.go | ||
v104.go | ||
v105.go | ||
v106.go | ||
v107.go | ||
v108.go | ||
v109.go | ||
v110.go | ||
v111.go | ||
v112.go | ||
v113.go | ||
v114.go | ||
v115.go | ||
v116.go | ||
v117.go | ||
v118.go | ||
v119.go | ||
v120.go | ||
v121.go | ||
v122.go | ||
v123.go | ||
v124.go | ||
v125.go | ||
v126.go | ||
v127.go | ||
v128.go | ||
v129.go | ||
v130.go | ||
v131.go | ||
v132.go | ||
v133.go | ||
v134.go | ||
v135.go | ||
v136.go | ||
v137.go | ||
v138.go | ||
v139.go | ||
v140.go | ||
v141.go | ||
v142.go | ||
v143.go | ||
v144.go | ||
v145.go | ||
v146.go | ||
v147.go | ||
v148.go | ||
v149.go | ||
v150.go | ||
v151.go | ||
v152.go | ||
v153.go | ||
v154.go | ||
v155.go | ||
v156.go | ||
v157.go | ||
v158.go | ||
v159.go | ||
v160.go | ||
v161.go | ||
v162.go | ||
v163.go | ||
v164.go | ||
v165.go | ||
v166.go | ||
v167.go | ||
v168.go | ||
v169.go | ||
v170.go | ||
v171.go | ||
v172.go | ||
v173.go | ||
v174.go | ||
v175.go | ||
v176_test.go | ||
v176.go | ||
v177_test.go | ||
v177.go | ||
v178.go | ||
v179.go | ||
v180.go | ||
v181_test.go | ||
v181.go | ||
v182_test.go | ||
v182.go | ||
v183.go | ||
v184.go | ||
v185.go | ||
v186.go | ||
v187.go | ||
v188.go | ||
v189_test.go | ||
v189.go |