Documentation ¶
Index ¶
- Constants
- func ConfigureHelper(userName, gitSigningKey string, log log.Logger) error
- func ExtractGitConfiguration() (string, string, error)
- func HandleGitSSHProgramCall(certPath, namespace, bufferFile string, log log.Logger) error
- func RemoveHelper(userName string) error
- type GitSSHSignatureRequest
- type GitSSHSignatureResponse
Constants ¶
const ( HelperScript = `#!/bin/bash devpod agent git-ssh-signature "$@" ` HelperScriptPath = "/usr/local/bin/devpod-ssh-signature" GitConfigTemplate = ` [gpg "ssh"] program = devpod-ssh-signature [gpg] format = ssh [user] signingkey = %s ` )
const ( GPGFormatConfigKey = "gpg.format" UsersSigningKeyConfigKey = "user.signingkey" GPGFormatSSH = "ssh" )
Variables ¶
This section is empty.
Functions ¶
func ConfigureHelper ¶
ConfigureHelper sets up the Git SSH signing helper script and updates the Git configuration for the specified user.
This function: - sets user.signingkey git config - creates a wrapper script for calling git-ssh-signature - users this script as gpg.ssh.program This is needed since git expects `gpg.ssh.program` to be an executable.
func ExtractGitConfiguration ¶
ExtractGitConfiguration is used for extracting values from users local .gitconfig that are needed to setup devpod-ssh-signature helper inside the workspace.
func HandleGitSSHProgramCall ¶
HandleGitSSHProgramCall implements logic handling call from git when signing a commit
func RemoveHelper ¶
RemoveHelper removes the git SSH signing helper script and any related configuration.
Types ¶
type GitSSHSignatureRequest ¶
func (*GitSSHSignatureRequest) Sign ¶
func (req *GitSSHSignatureRequest) Sign() (*GitSSHSignatureResponse, error)
Sign signs the content using the private key and returns the signature. This is intended to be a drop-in replacement for gpg.ssh.program for git, so we simply execute ssh-keygen in the same way as git would do locally.
type GitSSHSignatureResponse ¶
type GitSSHSignatureResponse struct {
Signature []byte
}