Repository navigation
docs: explain git identity and credentials in shared workspaces - #31152
Merged
nickvigilante merged 2 commits intoNov 3, 2026
Merged
nickvigilante merged 2 commits into
nickvigilante merged 2 commits into
Conversation
Shared users connect with the workspace owner's Git identity, Git SSH key, external auth tokens, and user secrets. The shared workspaces guide didn't say so, so owners sharing a personal workspace may not realize shared users can push with their source control permissions. Refs ENG-3444, closes #30278.
Contributor
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
nickvigilante
marked this pull request as ready for review
October 23, 2026 05:53
matifali
approved these changes
Nov 3, 2026
Collaborator
Author
|
@matifali re: your comment on automatic Git identity: agreed, that would be a better experience. Tracking it in #31706 so this PR can stay docs-only. One wrinkle: shared users run as the same OS user, so per-user external auth tokens would need isolation to avoid leaking one user's token to the others. Generated by Coder Agents on behalf of @nickvigilante. |
nickvigilante
deleted the
vigilante/eng-3444-docs-explain-git-identity-and-credentials-in-shared
branch
November 3, 2026 18:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Git identity and credentials section to the shared workspaces guide and links it from the persistent shared workspaces tutorial.
Every user of a shared workspace uses the owner's Git identity, Git SSH key, external auth tokens, and user secrets, and the docs didn't say so.
Closes #30278.
Refs ENG-3444.
Changes
docs/user-guides/shared-workspaces.md: new section that covers what resolves to the owner, the security implications, the service account recommendation, and how a shared user commits and pushes as themselves, with trade-offs.docs/tutorials/persistent-shared-workspaces.md: two sentences after the service account step that link to the new section.Where this differs from the issue
git -c user.name=... -c user.email=....It has no effect when the template sets
GIT_AUTHOR_*andGIT_COMMITTER_*, because Git env vars beat all config, including-c.The docs say this and recommend exporting the env vars or using
git commit --authorinstead.The docs say what commits look like and suggest putting the service account's
coder publickeyon a dedicated machine account.docs/user-guides/user-secrets.mdalready warns about this.Testing
coderd/gitsshkey.go(GetGitSSHKey(ctx, workspace.OwnerID)),coderd/workspaceagents.go(external auth links looked up byworkspace.OwnerID),agent/agent.go(GIT_SSH_COMMAND, env precedence),cli/agent.go(GIT_ASKPASS),cli/ssh.go(--forward-agent),examples/templates/docker/main.tf.GIT_*vars beatgit -c user.*,--authorchanges only the author, and an emptyGIT_AUTHOR_EMAILproducesname <>.markdownlint-cli2,make lint/emdash, and Vale pass on both files.The pre-commit hook passed.
Not verified end to end (please check)
coder ssh --forward-agentplusexport GIT_SSH_COMMAND=ssh) against a real Git provider from a shared workspace.gh auth setup-gittaking priority over Coder'sGIT_ASKPASSin a workspace.This is based on Git's documented credential order: helpers first, then askpass.
coder publickeyworks with a service account token.Generated by Coder Agents on behalf of @nickvigilante.