package auth

import "cmd/go/internal/auth"

Package auth provides access to user-provided authentication credentials.

gitauth uses 'git credential' to implement the GOAUTH protocol.

See https://git-scm.com/docs/gitcredentials or run 'man gitcredentials' for information on how to configure 'git credential'.

Code copied from x/net/http/httpguts/httplex.go

Package auth provides access to user-provided authentication credentials.

Index

Functions

func AddCredentials

func AddCredentials(client *http.Client, req *http.Request, res *http.Response, url string) bool

AddCredentials populates the request header with the user's credentials as specified by the GOAUTH environment variable. It returns whether any matching credentials were found. req must use HTTPS or this function will panic. res is used for the custom GOAUTH command's stdin.

Source Files

auth.go gitauth.go httputils.go netrc.go userauth.go

Version
v1.24.0 (latest)
Published
Feb 10, 2025
Platform
linux/amd64
Imports
17 packages
Last checked
11 minutes ago

Tools for package owners.