Documentation ¶
Overview ¶
Package auth provides common authentication tools NOTE: Subject to change, do not rely on this package from outside git-lfs source
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOperationForRequest ¶
GetOperationForRequest determines the operation type for a http.Request
func SaveCredentials ¶
func SaveCredentials(cfg *config.Configuration, creds Creds, res *http.Response)
Types ¶
type CredentialFunc ¶
Credentials function which will be called whenever credentials are requested
func GetCredentialsFunc ¶
func GetCredentialsFunc() CredentialFunc
GetCredentialsFunc returns the current credentials function
func SetCredentialsFunc ¶
func SetCredentialsFunc(f CredentialFunc) CredentialFunc
SetCredentialsFunc overrides the default credentials function (which is to call git) Returns the previous credentials func
type Creds ¶
func GetCreds ¶
getCreds gets the credentials for a HTTP request and sets the given request's Authorization header with them using Basic Authentication.
- Check the URL for authentication. Ex: http://user:pass@example.com
- Check netrc for authentication.
- Check the Git remote URL for authentication IF it's the same scheme and host of the URL.
- Ask 'git credential' to fill in the password from one of the above URLs.
This prefers the Git remote URL for checking credentials so that users only have to enter their passwords once for Git and Git LFS. It uses the same URL path that Git does, in case 'useHttpPath' is enabled in the Git config.
type SshAuthResponse ¶
type SshAuthResponse struct { Message string `json:"-"` Href string `json:"href"` Header map[string]string `json:"header"` ExpiresAt string `json:"expires_at"` }
func SshAuthenticate ¶
func SshAuthenticate(cfg *config.Configuration, operation, oid string) (SshAuthResponse, config.Endpoint, error)