upstreams

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAuthorized = errors.New("not authorized")

ErrNotAuthorized means that the public key is not authorized.

Functions

func All added in v0.4.0

func All(dataDir string) ([]string, error)

All returns the names of all upstreams.

func List

func List(dataDir string, publicKey ssh.PublicKey) (map[string]*Authorization, error)

List upstreams that are accessible with the given public key.

func ListAuthorized added in v0.4.0

func ListAuthorized(dataDir, upstream string) ([]string, error)

ListAuthorized returns the authorized key names for the given upstream.

Types

type Authorization

type Authorization struct {
	Filename string
	ssh.PublicKey
	Comment string
}

func AlwaysAuthorized

func AlwaysAuthorized(dataDir string, publicKey ssh.PublicKey) (*Authorization, error)

AlwaysAuthorized returns whether the given public key provides access to any upstream.

func Authorized

func Authorized(dataDir string, publicKey ssh.PublicKey, upstream string) (*Authorization, error)

Authorized returns the authorizations of the given public key on the given upstream.

Jump to

Keyboard shortcuts

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