harborauth

package module
v0.0.0-...-54ba49d Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: Apache-2.0 Imports: 7 Imported by: 2

README

harbor-auth-client

Grab the library via go get:

go get github.com/turnerlabs/harbor-auth-client

This library wraps the 3 auth calls for harbor auth.

Login

Login(username string, password string) (string, bool, error)

returns the token, whether the call was successful, and the error if one exists.

IsAuthenticated

IsAuthenticated(username string, token string) (bool, error)

returns whether the call was successful, and the error if one exists.

Logout

Logout(username string, token string) (bool, error)

returns whether the call was successful, and the error if one exists.

The code can be tested like this:

godep go test -v ./... -url=<auth service url> -username=<valid username> -password=<valid password>

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth interface {
	// Login -
	Login(username string, password string) (string, bool, error)
	// Logout
	Logout(username string, token string) (bool, error)
	// IsAuthenticated -
	IsAuthenticated(username string, token string) (bool, error)
}

Auth -

func NewAuthClient

func NewAuthClient(url string) (Auth, error)

NewAuthClient -

Jump to

Keyboard shortcuts

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