auth

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AUTHTYPE_COUCHDB_SESSION = "COUCHDB_SESSION"
)

Variables

This section is empty.

Functions

This section is empty.

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

	// CouchDB URL inherited from the service config.
	URL string

	// A flag that indicates whether verification of the server's SSL certificate should be disabled; INherired from the service config
	DisableSSLVerification bool
	// 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