auth

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 1 Imported by: 2 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package auth defines the Authenticator interface for verifying client identities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	// Authenticate validates the username and password. It returns the user
	// identifier id and whether authentication succeeded.
	// The id can be used for subsequent authorization and audit trails.
	Authenticate(ctx context.Context, user, password string, opts ...Option) (id string, ok bool)
}

Authenticator is the user authentication interface. In proxy scenarios, authentication happens after the client connection is established and before any request is processed. Only authenticated connections are allowed to proceed.

type Option

type Option func(opts *Options)

Option is a functional option for configuring Options.

func WithService added in v0.6.1

func WithService(service string) Option

WithService sets the service name.

type Options

type Options struct {
	// Service is the service name this authenticator belongs to.
	Service string
}

Options holds the initialization parameters for an Authenticator.

Jump to

Keyboard shortcuts

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