Sha256: d348ef19cba6704bac5e1bb7429ca6c304f5d52ab2c9d8b9c3213b66bc98d2d6

Contents?: true

Size: 456 Bytes

Versions: 36

Compression:

Stored size: 456 Bytes

Contents

package <%= package %>

import (
	"net/http"
)

type BasicAuth struct {
	Username string
	Password string
}

func (auth *BasicAuth) Authenticate(request *http.Request) {
	request.SetBasicAuth(auth.Username, auth.Password)
}

// SetBasicAuthentication enables HTTP basic auth on the client
func (client *Client) SetBasicAuthentication(username string, password string) {
	client.Authentication = &BasicAuth{
		Username: username,
		Password: password,
	}
}

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
haveapi-go-client-0.25.0 template/authentication/basic.go.erb
haveapi-go-client-0.24.0 template/authentication/basic.go.erb
haveapi-go-client-0.23.7 template/authentication/basic.go.erb
haveapi-go-client-0.23.6 template/authentication/basic.go.erb
haveapi-go-client-0.23.5 template/authentication/basic.go.erb
haveapi-go-client-0.23.4 template/authentication/basic.go.erb
haveapi-go-client-0.23.3 template/authentication/basic.go.erb
haveapi-go-client-0.23.2 template/authentication/basic.go.erb
haveapi-go-client-0.23.1 template/authentication/basic.go.erb
haveapi-go-client-0.23.0 template/authentication/basic.go.erb
haveapi-go-client-0.22.1 template/authentication/basic.go.erb
haveapi-go-client-0.22.0 template/authentication/basic.go.erb
haveapi-go-client-0.21.1 template/authentication/basic.go.erb
haveapi-go-client-0.21.0 template/authentication/basic.go.erb
haveapi-go-client-0.20.0 template/authentication/basic.go.erb
haveapi-go-client-0.19.3 template/authentication/basic.go.erb
haveapi-go-client-0.19.2 template/authentication/basic.go.erb
haveapi-go-client-0.19.1 template/authentication/basic.go.erb
haveapi-go-client-0.19.0 template/authentication/basic.go.erb
haveapi-go-client-0.18.2 template/authentication/basic.go.erb