Refactor: Move login out of models #16199
No reviewers
Labels
No Label
backport/done
backport/v1.0
backport/v1.1
backport/v1.10
backport/v1.11
backport/v1.12
backport/v1.13
backport/v1.14
backport/v1.15
backport/v1.2
backport/v1.3
backport/v1.4
backport/v1.5
backport/v1.6
backport/v1.7
backport/v1.8
backport/v1.9
bounty
changelog
dependencies
frontport/done
frontport/main
good first issue
Hacktoberfest
hacktoberfest-accepted
in progress
kind/api
kind/breaking
kind/bug
kind/build
kind/deployment
kind/deprecated
kind/docs
kind/enhancement
kind/feature
kind/lint
kind/misc
kind/moderation
kind/package
kind/proposal
kind/question
kind/refactor
kind/regression
kind/security
kind/summary
kind/testing
kind/translation
kind/ui
kind/upstream-related
kind/usability
kind/ux
lgtm/done
lgtm/need 1
lgtm/need 2
performance/bigrepo
performance/cpu
performance/memory
performance/speed
priority/critical
priority/low
priority/maybe
priority/medium
proposal/rejected
reviewed/confirmed
reviewed/duplicate
reviewed/fixed
reviewed/invalid
reviewed/not-a-bug
reviewed/wontfix
skip-changelog
stale
status/blocked
status/needs-feedback
status/wip
theme/2fa
theme/authentication
theme/avatar
theme/backup-restore
theme/docker
theme/federation
theme/issues
theme/kanban
theme/markdown
theme/migration
theme/mobile
theme/pr
theme/signing
theme/sqlite
theme/timetracker
theme/webhook
theme/wiki
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: lunny/gitea#16199
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "move-login-out-of-models"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
models
does far too much. In particular it handles allUserSignin
.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 inservices
.There is a package in
services
calledauth
and clearly this functionality belongs in there.Plan:
auth.Auth
toauth.Method
- as they represent methods of authentication.models.UserSignIn
intoauth
models.ExternalUserLogin
LoginVia*
methods toauth
or subpackagesauth
models/ssh_key.go
to reduce the size of this massive file and simplify its files.auth.Source
?@ -0,0 +1,219 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
SSH related files should also be moved out of models
@ -0,0 +1,219 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
One thing at a time...
@ -0,0 +1,219 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
But you have split them from old file?
@ -0,0 +1,219 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
On the advice from @6543 and to prepare for that move.
I think this is already going to be difficult enough to get reviewed without adding in another refactor but if you'd like it in here I can do that.
The issue is that it'll need to be one of the first things merged in 1.16 if not the first thing as it'll be too easy conflict.
@ -0,0 +1,219 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
I think we can keep ssh related code unchanged in this PR or move them to another PR.
@ -0,0 +1,219 @@
// Copyright 2021 The Gitea Authors. All rights reserved.
The changes that have been made are necessary for this PR.