auth

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AUTHTYPE_COUCHDB_SESSION = "COUCHDB_SESSION"
)

Variables

This section is empty.

Functions

func GetAuthenticatorFromEnvironment

func GetAuthenticatorFromEnvironment(credentialKey string) (core.Authenticator, error)

GetAuthenticatorFromEnvironment instantiates an Authenticator using service properties retrieved from external config sources.

Types

type CouchDbSessionAuthenticator

type CouchDbSessionAuthenticator struct {
	// [Required] The username and password used to access CouchDB session end-point
	Username, Password string

	// [Optional] The http.Client object used to to obtain CouchDB authentication cookie.
	// If not specified by the user, a suitable default Client will be constructed.
	Client *http.Client
	// contains filtered or unexported fields
}

CouchDbSessionAuthenticator uses username and password to obtain CouchDB authentication cookie, and adds the cookie to requests.

func NewCouchDbSessionAuthenticator

func NewCouchDbSessionAuthenticator(username, password string) (*CouchDbSessionAuthenticator, error)

NewCouchDbSessionAuthenticator constructs a new NewCouchDbSessionAuthenticator instance.

func NewCouchDbSessionAuthenticatorFromMap

func NewCouchDbSessionAuthenticatorFromMap(props map[string]string) (*CouchDbSessionAuthenticator, error)

NewCouchDbSessionAuthenticatorFromMap constructs a new NewCouchDbSessionAuthenticator instance from a map.

func (*CouchDbSessionAuthenticator) Authenticate

func (a *CouchDbSessionAuthenticator) Authenticate(request *http.Request) error

Authenticate adds session authentication cookie to a request.

func (*CouchDbSessionAuthenticator) AuthenticationType

func (a *CouchDbSessionAuthenticator) AuthenticationType() string

AuthenticationType returns the authentication type for this authenticator.

func (*CouchDbSessionAuthenticator) Validate

func (a *CouchDbSessionAuthenticator) Validate() error

Validate the authenticator's configuration. Ensures the service url, username and password are valid and not nil.

Jump to

Keyboard shortcuts

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