authenticators

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package authenticators contains authenticator interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response added in v0.37.0

type Response struct {
	User                   user.Info
	DN                     string
	ExtraRefreshAttributes map[string]string
}

type UserAuthenticator

type UserAuthenticator interface {
	AuthenticateUser(ctx context.Context, username, password string) (*Response, bool, error)
}

This interface is similar to the k8s token authenticator, but works with username/passwords instead of a single token string.

The return values should be as follows. 1. For a successful authentication:

  • A response which includes the username, uid, and groups in the userInfo. The username and uid must not be blank.
  • true
  • nil error

2. For an unsuccessful authentication, e.g. bad username or password:

  • nil response
  • false
  • nil error

3. For an unexpected error, e.g. a network problem:

  • nil response
  • false
  • an error

Other combinations of return values must be avoided.

See k8s.io/apiserver/pkg/authentication/authenticator/interfaces.go for the token authenticator interface, as well as the Response type.

Jump to

Keyboard shortcuts

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