Help us shape the future of Go! Take the 2026 Go Developer Survey

authentication

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stream

Stream returns the interceptor that runs a stream call under the context the Authenticator returns, unless Anonymous lists the call.

func Unary

Unary returns the interceptor that runs a unary call under the context the Authenticator returns, unless Anonymous lists the call.

Types

type Anonymous

type Anonymous struct {
	Services []string
	Methods  []string
}

Anonymous lists the services and the full methods that run without a credential.

type Authenticator

type Authenticator interface {
	Authenticate(ctx context.Context, credential string) (context.Context, error)
}

Authenticator checks the bearer credential of a call and returns the context the handler runs under, or an error that fails the call.

Jump to

Keyboard shortcuts

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