auth

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 2 Imported by: 3

Documentation

Overview

Package auth maps forge credentials to safe Git HTTPS configuration.

Index

Constants

View Source
const (
	SCMGitHub    = "github"
	SCMGitLab    = "gitlab"
	SCMBitbucket = "bitbucket"
)

SCM name constants for Credential.SCM and InferSCM.

Variables

This section is empty.

Functions

func GitConfigArgs

func GitConfigArgs(cred Credential) []string

Build authenticated Git HTTPS header args for http.extraHeader. Empty token yields nil.

func InferSCM

func InferSCM(remoteURL string) string

InferSCM guesses the forge from an HTTPS remote URL host.

func RedactToken

func RedactToken(token string) string

RedactToken returns a safe placeholder when token is non-empty.

Types

type Credential

type Credential struct {
	Token string
	SCM   string // github, gitlab, bitbucket, or empty for GitHub-style default
}

Credential is a forge-scoped HTTPS token for Git smart HTTP.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL