auth

package
v4.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package auth manages authorization and authentication for kivikd.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	// MethodName identifies the handler. It is only called once on server
	// start up.
	MethodName() string
	// Authenticate authenticates the HTTP request. On success, a user context
	// must be returned. Any error will immediately terminate the authentication
	// process, returning an error to the client. In particular, this means that
	// an "unauthorized" error must not be returned if fallthrough is intended.
	// If a response is sent, execution does not continue. This allows handlers
	// to expose their own API endpoints (for example, the default cookie auth
	// handler adds POST /_session and DELETE /_session handlers).
	Authenticate(http.ResponseWriter, *http.Request) (*authdb.UserContext, error)
}

Handler is an auth handler.

type Session

type Session struct {
	AuthMethod string
	AuthDB     string
	Handlers   []string
	User       *authdb.UserContext
}

Session represents an authenticated session.

func (*Session) MarshalJSON

func (s *Session) MarshalJSON() ([]byte, error)

MarshalJSON satisfies the json.Marshaler interface.

Directories

Path Synopsis
Package basic provides HTTP Basic Auth services.
Package basic provides HTTP Basic Auth services.
Package cookie provides standard CouchDB cookie auth as described at http://docs.couchdb.org/en/2.0.0/api/server/authn.html#cookie-authentication
Package cookie provides standard CouchDB cookie auth as described at http://docs.couchdb.org/en/2.0.0/api/server/authn.html#cookie-authentication

Jump to

Keyboard shortcuts

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