wsse

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2016 License: MIT Imports: 6 Imported by: 0

README

go-orocrm-wsse GoDoc Build Status Go Report Card Software License Code Climate

Go WSSE transport (http.RoundTripper)

Usage

As RoundTripper
import (
	wsse "github.com/banovo/go-orocrm-wsse"
)

func main() {
	req, err := http.NewRequest(http.MethodGet, url, nil)
	t := wsse.NewTransport("my-user", "my-password-or-api-key")
	resp, err := t.RoundTrip(req)
	// do whatever you want
}
X-WSSE Header string only
import (
	wsse "github.com/banovo/go-orocrm-wsse"
)

func main() {
	fmt.Println(wsse.CreateHeader("my-user", "my-password-or-api-key"))
}

Difference to the forked package

This is an update of motemen's package. We avoid binary data and changed the date to ISO 8601. We do this because php and orocrm and the corresponding package and EscapeWSSEAuthenticationBundle seem to have problems with the orginal data.

Thanks

Special thanks to @motemen and his wsse package we (needed) to fork from.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHeader added in v0.3.0

func CreateHeader(username, password string) (string, error)

CreateHeader return the X-WSSE header key as string

Types

type Transport

type Transport struct {
	Username string
	Password string

	WSSE string

	Transport http.RoundTripper
}

Transport implements http.Transport. It adds X-WSSE header to client requests.

func NewTransport added in v0.3.0

func NewTransport(username, password string) *Transport

NewTransport creates a new transport

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip executes the HTTP request with an X-WSSE header.

Jump to

Keyboard shortcuts

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