Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(cli): add SSH commit signing support with gitsign command#20245

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
michaelbeutler wants to merge2 commits intocoder:main
base:main
Choose a base branch
Loading
frommichaelbeutler:main

Conversation

michaelbeutler
Copy link

Summary

This PR adds SSH commit signing functionality to Coder, enabling users to sign Git commits using their Coder SSH keys as an alternative to GPG signing. This builds on the existing Git SSH authentication system to provide a seamless signing experience.

Changes

New CLI Command

  • coder gitsign: Hidden command that retrieves SSH keys from the agent and signs commit messages usingssh-keygen -Y sign
  • Follows the same authentication patterns as the existinggitssh command
  • Implements secure temporary key file handling with automatic cleanup
  • Supports standard SSH signing protocol for Git commits

Agent Environment Configuration

  • Modified agent to setGIT_CONFIG_GLOBAL environment variable
  • Configures Git to use SSH signing instead of GPG:
    • gpg.format=ssh - enables SSH signing mode
    • gpg.ssh.program=coder gitsign - points to our signing command
    • commit.gpgsign=false - prevents automatic signing (user controlled)

Test Coverage

  • Integration tests:TestGitSign with basic operation and key retrieval verification
  • Agent tests:TestAgent_GitConfig validates environment variable setup
  • All tests pass successfully and follow existing test patterns

How It Works

  1. Setup: Agent configures Git environment to use SSH signing viaGIT_CONFIG_GLOBAL
  2. Signing: When Git needs to sign a commit, it callscoder gitsign
  3. Authentication: Command authenticates with Coder agent and retrieves user's SSH key
  4. Execution: Usesssh-keygen -Y sign to sign the commit message
  5. Cleanup: Temporary key files are securely removed

Usage

Users automatically get SSH commit signing enabled in Coder workspaces. Git will use their Coder SSH key to sign commits when configured to do so, providing an alternative to GPG signing without additional setup.

Testing

# Unit tests passgotest ./cli -run TestGitSigngotest ./agent -run TestAgent_GitConfig# Manual verificationcoder gitsign --help# Shows command help

Related

  • Extends existing Git SSH authentication functionality
  • Uses same SSH key management asgitssh command
  • No breaking changes to existing functionality

AI Contribution Notice: This implementation was developed with AI assistance following Coder'sAI Contribution Guidelines. All code has been reviewed for correctness, security, and alignment with existing patterns.

Add gitsign command and SSH signing configuration to enable users to sign Git commits using their Coder SSH keys as an alternative to GPG signing.- Add gitsign command that retrieves SSH keys from agent and signs commit messages- Configure agent environment to enable SSH signing in Git (gpg.format=ssh)- Add comprehensive test coverage for both CLI command and agent configuration- Implement secure temporary key file handling with automatic cleanup- Follow existing gitssh patterns for authentication and key management
@cdr-botcdr-botbot added the communityPull Requests and issues created by the community. labelOct 9, 2025
@github-actionsGitHub Actions
Copy link

github-actionsbot commentedOct 9, 2025
edited
Loading

All contributors have signed the CLA ✍️ ✅
Posted by theCLA Assistant Lite bot.

@michaelbeutler
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

cdrci2 added a commit to coder/cla that referenced this pull requestOct 9, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@michaelbeutlermichaelbeutler

Labels
communityPull Requests and issues created by the community.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@michaelbeutler

[8]ページ先頭

©2009-2025 Movatter.jp