fix: show selected owner's external auth when creating a workspace (#26653)

This commit is contained in:
McKayla はな
2026-07-23 16:39:53 -06:00
committed by GitHub
parent d5a3963167
commit 3cf97ff8e7
19 changed files with 377 additions and 49 deletions
+2 -2
View File
@@ -873,8 +873,8 @@ func createWorkspace(
// at build time uses the owner's external auth links, so the owner is the
// subject of the check even when another user initiates the build.
func (api *API) requireWorkspaceOwnerExternalAuth(ctx context.Context, templateVersion database.TemplateVersion, ownerID uuid.UUID) error {
//nolint:gocritic // System access is required to validate the workspace owner's external auth links because admins and API clients may create workspaces for other users.
providers, err := api.templateVersionExternalAuthForUser(dbauthz.AsSystemRestricted(ctx), templateVersion, ownerID)
//nolint:gocritic // Reads/refreshes the external auth links. Necessary when admins create workspaces for other users.
providers, err := api.templateVersionExternalAuthForUser(dbauthz.AsExternalAuthCoordinator(ctx), templateVersion, ownerID)
if err != nil {
return err
}