auth

package
v0.0.0-...-9abcee2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2016 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Authorization Headers
	SdcSignature   = "Signature keyId=\"/%s/keys/%s\",algorithm=\"%s\" %s"
	MantaSignature = "Signature keyId=\"/%s/keys/%s\",algorithm=\"%s\",signature=\"%s\""
)

Variables

This section is empty.

Functions

func CreateAuthorizationHeader

func CreateAuthorizationHeader(headers http.Header, credentials *Credentials, isMantaRequest bool) (string, error)

The CreateAuthorizationHeader returns the Authorization header for the give request.

func GetSignature

func GetSignature(auth *Auth, signing string) (string, error)

The GetSignature method signs the specified key according to http://apidocs.joyent.com/cloudapi/#issuing-requests and http://apidocs.joyent.com/manta/api.html#authentication.

Types

type Auth

type Auth struct {
	User       string
	PrivateKey PrivateKey
	Algorithm  string
}

func NewAuth

func NewAuth(user, privateKey, algorithm string) (*Auth, error)

NewAuth creates a new Auth.

type Credentials

type Credentials struct {
	UserAuthentication *Auth
	SdcKeyId           string
	SdcEndpoint        Endpoint
	MantaKeyId         string
	MantaEndpoint      Endpoint
}

func (*Credentials) Region

func (cred *Credentials) Region() string

type Endpoint

type Endpoint struct {
	URL string
}

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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