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

Filter inactive auth sources #27870

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Conversation

KN4CK3R
Copy link
Member

@KN4CK3R KN4CK3R commented Nov 1, 2023

Fix nil access for inactive auth sources.

Render failed, failed to render template: user/settings/security/security, error: template error: builtin(static):user/settings/security/accountlinks:32:20 : executing "user/settings/security/accountlinks" at <$providerData.IconHTML>: nil pointer evaluating oauth2.Provider.IconHTML

Code tries to access the auth source of an ExternalLoginUser but the list contains only the active auth sources.

@KN4CK3R KN4CK3R added type/bug backport/v1.20 This PR should be backported to Gitea 1.20 backport/v1.21 This PR should be backported to Gitea 1.21 labels Nov 1, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 1, 2023
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 1, 2023
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Nov 1, 2023
@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 Nov 1, 2023
@lafriks lafriks merged commit e378545 into go-gitea:main Nov 1, 2023
25 checks passed
@GiteaBot GiteaBot added this to the 1.22.0 milestone Nov 1, 2023
@GiteaBot
Copy link
Contributor

GiteaBot commented Nov 1, 2023

I was unable to create a backport for 1.20. @KN4CK3R, please send one manually. 🍵

go run ./contrib/backport 27870
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label Nov 1, 2023
@GiteaBot
Copy link
Contributor

GiteaBot commented Nov 1, 2023

I was unable to create a backport for 1.21. @KN4CK3R, please send one manually. 🍵

go run ./contrib/backport 27870
...  // fix git conflicts if any
go run ./contrib/backport --continue

zjjhot added a commit to zjjhot/gitea that referenced this pull request Nov 2, 2023
* giteaofficial/main:
  Filter inactive auth sources (go-gitea#27870)
  refactor postgres connection string building (go-gitea#27723)
  doc: actions/act-runner: document running as a systemd service (go-gitea#27844)
  Support storage base path as prefix (go-gitea#27827)
@lunny
Copy link
Member

lunny commented Nov 2, 2023

This will hide the unactive provider's linked accounts and users cannot unlink them from the UI. I have sent #27798 which could resolve the problem entirely.

@lunny lunny removed backport/v1.20 This PR should be backported to Gitea 1.20 backport/v1.21 This PR should be backported to Gitea 1.21 labels Nov 2, 2023
KN4CK3R added a commit to KN4CK3R/gitea that referenced this pull request Nov 5, 2023
@KN4CK3R KN4CK3R mentioned this pull request Nov 5, 2023
@KN4CK3R KN4CK3R deleted the fix-disabled-auth-source branch November 5, 2023 19:20
lunny pushed a commit that referenced this pull request Nov 6, 2023
Now that we have #27798 we don't need the check from #27870 anymore.
With the check it's not possible to remove an inactive auth source from
the user.
zjjhot added a commit to zjjhot/gitea that referenced this pull request Nov 6, 2023
* upstream/main:
  Fix edit topic UI (go-gitea#27925)
  Unify two factor check (go-gitea#27915)
  Revert go-gitea#27870 (go-gitea#27917)
  Fix JS NPE when viewing specific range of PR commits (go-gitea#27912)
  Install poetry dependencies with --no-root (go-gitea#27919)
  Show correct commit sha when viewing single commit diff (go-gitea#27916)
  Fix 500 when deleting a dismissed review (go-gitea#27903)
  Remove action runners on user deletion (go-gitea#27902)
  Remove SSH workaround (go-gitea#27893)
  Remove "tabindex" from some form buttons (go-gitea#27892)
  Refactor the function RemoveOrgUser (go-gitea#27582)
  Fix DownloadFunc when migrating releases (go-gitea#27887)
@lng2020 lng2020 removed the backport/manual No power to the bots! Create your backport yourself! label Nov 12, 2023
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
Fix nil access for inactive auth sources.

> Render failed, failed to render template:
user/settings/security/security, error: template error:
builtin(static):user/settings/security/accountlinks:32:20 : executing
"user/settings/security/accountlinks" at <$providerData.IconHTML>: nil
pointer evaluating oauth2.Provider.IconHTML

Code tries to access the auth source of an `ExternalLoginUser` but the
list contains only the active auth sources.
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
Now that we have go-gitea#27798 we don't need the check from go-gitea#27870 anymore.
With the check it's not possible to remove an inactive auth source from
the user.
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jan 31, 2024
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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants