winrmkrb5

package module
v0.0.0-...-c29a221 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: MIT Imports: 10 Imported by: 2

README

winrm-auth-krb5

Krb5 Transporter for the masterzen's Go WinRM client.

Windows & Linux implementations are very different! Please check https://github.com/dpotapov/go-spnego for details.

Installation:

go get github.com/dpotapov/winrm-auth-krb5

Usage:

endpoint := winrm.NewEndpoint(*host, *port, false, false, nil, nil, nil, 0)

winrm.DefaultParameters.TransportDecorator = func() winrm.Transporter {
    return &winrmkrb5.Transport{}
}

// Note, username/password pair in the NewClientWithParameters call is ignored
client, err := winrm.NewClientWithParameters(endpoint, "", "", winrm.DefaultParameters)
if err != nil {
    panic(err)
}

_, err = client.Run(flag.Arg(0), os.Stdout, os.Stderr)
if err != nil {
    panic(err)
}

Please check the full example in the example directory.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

type Transport struct {
	HTTPClient *http.Client
	Endpoint   *winrm.Endpoint
}

Transport implements the winrm.Transporter interface.

func (*Transport) EndpointURL

func (t *Transport) EndpointURL() string

EndpointURL returns a WinRM http(s) URL. It does the same job as unexported method url() for the winrm.Endpoint type.

func (*Transport) Post

func (t *Transport) Post(client *winrm.Client, request *soap.SoapMessage) (string, error)

Post sends a POST request to WinRM server with the provided SOAP payload. If the WinRM web service responds with Unauthorized status, the method performs KRB5 authentication.

func (*Transport) Transport

func (t *Transport) Transport(endpoint *winrm.Endpoint) error

Transport applies configuration parameters from the Endpoint to the underlying HTTPClient. If the HTTPClient is nil, a new instance of http.Client will be created.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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