kerberos

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package kerberos provides Kerberos v5 sasl authentication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kerberos

func Kerberos(authFn func(context.Context) (Auth, error)) sasl.Mechanism

Kerberos returns a sasl mechanism that will call authFn whenever sasl authentication is needed. The returned Auth is used for a single session.

Types

type Auth

type Auth struct {
	// Client is a Kerberos client.
	Client *client.Client

	// Service is the service name we will get a ticket for.
	Service string

	// PersistAfterAuth specifies whether the client should persist after
	// logging in or if it should be destroyed (the default).
	//
	// If persisting, we never call client.Destroy ourselves, and it is
	// expected that you will return the same client in every authFn. The
	// client itself spins up a goroutine to automatically renew sessions,
	// thus if you return the same client, nothing leaks, but if you return
	// a new client on every call and set PersistAfterAuth, goroutines will
	// leak.
	PersistAfterAuth bool
}

Auth contains a Kerberos client and the service name that we will use to get a ticket for.

func (Auth) AsMechanism

func (a Auth) AsMechanism() sasl.Mechanism

AsMechanism returns a sasl mechanism that will use a as credentials for all sasl sessions.

This is a shortcut for using the Kerberos function and is useful when you do not need to live-rotate credentials.

Jump to

Keyboard shortcuts

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