Documentation
¶
Index ¶
- func ConfigureHelper(ctx context.Context, binaryPath, userName string, port int) error
- func GetHTTPPath(ctx context.Context, params GetHttpPathParameters) (string, error)
- func GetLocalGitConfigPath(repoPath string) string
- func RemoveHelper(ctx context.Context, userName string) error
- func RemoveHelperFromPath(ctx context.Context, gitConfigPath string) error
- func SetUser(ctx context.Context, userName string, user *GitUser) error
- func SetupGpgGitKey(ctx context.Context, gitSignKey string) error
- type GetHttpPathParameters
- type GitCredentials
- type GitUser
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureHelper ¶
ConfigureHelper installs credential helper into the user's global git config, replacing any previously configured helper.
func GetHTTPPath ¶
func GetHTTPPath(ctx context.Context, params GetHttpPathParameters) (string, error)
GetHTTPPath returns the repository path component when git's `credential.<url>.useHttpPath` is enabled for the host+protocol, else "".
func GetLocalGitConfigPath ¶
GetLocalGitConfigPath resolves the local git config for a repository path.
func RemoveHelper ¶
RemoveHelper removes credential helper from the user's global config.
func RemoveHelperFromPath ¶
RemoveHelperFromPath removes the credential.helper setting from the config at path, leaving any other credential.* settings intact.
Types ¶
type GetHttpPathParameters ¶
type GitCredentials ¶
type GitCredentials struct {
Protocol string `json:"protocol,omitempty"`
URL string `json:"url,omitempty"`
Host string `json:"host,omitempty"`
Path string `json:"path,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
GitCredentials is the git credential-helper record. Its wire form is git's documented key=value line protocol (see gitcredentials(7)).
func GetCredentials ¶
func GetCredentials(ctx context.Context, request *GitCredentials) (*GitCredentials, error)
GetCredentials resolves credentials for a request, using devsy's credential server when a helper port is configured, otherwise `git credential fill`.
func ParseCredentials ¶ added in v1.4.1
func ParseCredentials(raw string) GitCredentials
ParseCredentials parses git's key=value credential line format. It is the inverse of Encode. Unknown keys are ignored, matching git's tolerant parsing.
func (GitCredentials) Encode ¶ added in v1.4.1
func (c GitCredentials) Encode() string
Encode renders the credentials in git's key=value line format, terminated by a trailing newline. Only non-empty fields are emitted, matching git's helper protocol.