Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor auth #17962

Merged
merged 10 commits into from
Jan 2, 2022
Merged

refactor auth #17962

merged 10 commits into from
Jan 2, 2022

Conversation

lunny
Copy link
Member

@lunny lunny commented Dec 12, 2021

  • Rename models/login to models/auth
  • Move auth related routers into a standalone sub package
  • Move security setting files into a sub security folder
  • Move security_*.tmpl into security/*.tmpl

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Dec 12, 2021
Copy link
Member

@KN4CK3R KN4CK3R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit test fail seems related but I don't know how. Looks like db.DefaultContext is nil? Otherwise lgtm.

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Dec 12, 2021
@lunny lunny force-pushed the lunny/auth_refactor branch 2 times, most recently from 240d8a3 to 565f720 Compare December 13, 2021 07:03
@lunny lunny mentioned this pull request Dec 15, 2021
3 tasks
routers/web/auth/2fa.go Outdated Show resolved Hide resolved
@wxiaoguang
Copy link
Contributor

Some comments are broken by replacing login. to empty string.

image

@lunny lunny force-pushed the lunny/auth_refactor branch 3 times, most recently from 2e865dc to 6f27865 Compare December 20, 2021 16:12
@lunny
Copy link
Member Author

lunny commented Dec 20, 2021

Some comments are broken by replacing login. to empty string.

image

done.

@codecov-commenter

This comment has been minimized.

routers/web/auth/2fa.go Outdated Show resolved Hide resolved
routers/web/auth/2fa.go Show resolved Hide resolved
routers/web/auth/auth.go Outdated Show resolved Hide resolved
routers/web/auth/linkaccount.go Outdated Show resolved Hide resolved
routers/web/auth/password.go Outdated Show resolved Hide resolved
routers/web/auth/password.go Show resolved Hide resolved
routers/web/auth/password.go Outdated Show resolved Hide resolved
routers/web/auth/u2f.go Show resolved Hide resolved
@lunny
Copy link
Member Author

lunny commented Jan 2, 2022

@wxiaoguang I think all done.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 2, 2022
@wxiaoguang wxiaoguang merged commit de8e394 into go-gitea:main Jan 2, 2022
@lunny lunny deleted the lunny/auth_refactor branch January 2, 2022 14:32
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 4, 2022
* giteaoffical/main: (22 commits)
  Add MP4 as default allowed attachment type (go-gitea#18170)
  [skip ci] Updated translations via Crowdin
  Include folders into size cost (go-gitea#18158)
  Don't delete branch if other PRs with this branch are open (go-gitea#18164)
  Remove unused route "/tasks/trigger" (go-gitea#18160)
  Fix EasyMDE validation (go-gitea#18161)
  Fix bug (go-gitea#18168)
  tests: add coverage for models migration helpers  (go-gitea#18162)
  [skip ci] Updated translations via Crowdin
  Require codereview to have content (go-gitea#18156)
  chore(lint): use golangci-lint to call revive and misspell checker. (go-gitea#18145)
  Update owners for 2022 (go-gitea#18155)
  Refactor auth package (go-gitea#17962)
  Unify and simplify TrN for i18n (go-gitea#18141)
  Use correct user when determining max repo limits for error messages (go-gitea#18153)
  Add singuliere to MAINTAINERS (go-gitea#18148)
  [skip ci] Updated licenses and gitignores
  Add API to get issue/pull comments and events (timeline) (go-gitea#17403)
  Upgrade certmagic from v0.14.1 to v0.15.2 (go-gitea#18138)
  Upgrade certmagic from v0.14.1 to v0.15.2 (go-gitea#18138)
  ...
zeripath added a commit to zeripath/gitea that referenced this pull request Feb 2, 2022
There was an unfortunate regression in go-gitea#17962 where following detection of the
UserProhibitLogin error the err is cast to a pointer by mistake.

This causes a panic due to an interface error.

Fix go-gitea#18561

Signed-off-by: Andrew Thornton <[email protected]>
zeripath added a commit to zeripath/gitea that referenced this pull request Feb 2, 2022
Backport go-gitea#18562

There was an unfortunate regression in go-gitea#17962 where following detection of the
UserProhibitLogin error the err is cast to a pointer by mistake.

This causes a panic due to an interface error.

Fix go-gitea#18561

Signed-off-by: Andrew Thornton <[email protected]>
zeripath added a commit that referenced this pull request Feb 3, 2022
There was an unfortunate regression in #17962 where following detection of the
UserProhibitLogin error the err is cast to a pointer by mistake.

This causes a panic due to an interface error.

Fix #18561

Signed-off-by: Andrew Thornton <[email protected]>
lunny pushed a commit that referenced this pull request Feb 3, 2022
Backport #18562

There was an unfortunate regression in #17962 where following detection of the
UserProhibitLogin error the err is cast to a pointer by mistake.

This causes a panic due to an interface error.

Fix #18561

Signed-off-by: Andrew Thornton <[email protected]>
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
There was an unfortunate regression in go-gitea#17962 where following detection of the
UserProhibitLogin error the err is cast to a pointer by mistake.

This causes a panic due to an interface error.

Fix go-gitea#18561

Signed-off-by: Andrew Thornton <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants