Skip to content

Fix panic when listing malformed SSO users in web UI#54673

Merged
hugoShaka merged 4 commits intomasterfrom
hugo/fix-panic-in-webapi-users
May 9, 2025
Merged

Fix panic when listing malformed SSO users in web UI#54673
hugoShaka merged 4 commits intomasterfrom
hugo/fix-panic-in-webapi-users

Conversation

@hugoShaka
Copy link
Copy Markdown
Contributor

This PR fixes a panic that happens if a user is of type SSO but doesn't have a CreatedBy.Connector field.

GetUserType can return sso even if CreatedBy.Connector is nil:

// GetUserType indicates if the User was created by an SSO Provider or locally.
func (u UserV2) GetUserType() UserType {
	if u.GetCreatedBy().Connector != nil ||
		len(u.GetOIDCIdentities()) > 0 ||
		len(u.GetGithubIdentities()) > 0 ||
		len(u.GetSAMLIdentities()) > 0 {

		return UserTypeSSO
	}

	return UserTypeLocal
}

Changelog: fix a bug causing a malformed user to break Teleport web UI's "Users" page

Comment thread lib/web/ui/user.go Outdated
hugoShaka and others added 2 commits May 9, 2025 12:05
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Comment thread lib/web/ui/user.go
Co-authored-by: rosstimothy <39066650+rosstimothy@users.noreply.github.com>
@hugoShaka hugoShaka enabled auto-merge May 9, 2025 16:16
@hugoShaka hugoShaka added this pull request to the merge queue May 9, 2025
Merged via the queue into master with commit 91777a4 May 9, 2025
41 of 42 checks passed
@hugoShaka hugoShaka deleted the hugo/fix-panic-in-webapi-users branch May 9, 2025 17:29
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@hugoShaka See the table below for backport results.

Branch Result
branch/v15 Create PR
branch/v16 Create PR
branch/v17 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants