identityfile

package
v4.3.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package identityfile handles formatting and parsing of identity files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(filePath string, key *client.Key, format Format, clusterAddr string) (filesWritten []string, err error)

Write takes a username + their credentials and saves them to disk in a specified format.

clusterAddr is only used with FormatKubernetes.

filePath is used as a base to generate output file names; these names are returned in filesWritten.

Types

type Format

type Format string

Format describes possible file formats how a user identity can be stored.

const (
	// FormatFile is when a key + cert are stored concatenated into a single file
	FormatFile Format = "file"

	// FormatOpenSSH is OpenSSH-compatible format, when a key and a cert are stored in
	// two different files (in the same directory)
	FormatOpenSSH Format = "openssh"

	// FormatTLS is a standard TLS format used by common TLS clients (e.g. GRPC) where
	// certificate and key are stored in separate files.
	FormatTLS Format = "tls"

	// FormatKubernetes is a standard Kubernetes format, with all credentials
	// stored in a "kubeconfig" file.
	FormatKubernetes Format = "kubernetes"

	// DefaultFormat is what Teleport uses by default
	DefaultFormat = FormatFile
)

type IdentityFile

type IdentityFile struct {
	PrivateKey []byte
	Certs      struct {
		SSH []byte
		TLS []byte
	}
	CACerts struct {
		SSH [][]byte
		TLS [][]byte
	}
}

IdentityFile represents the basic components of an identity file.

func Decode

func Decode(r io.Reader) (*IdentityFile, error)

Decode attempts to break up the contents of an identity file into its respective components.

Jump to

Keyboard shortcuts

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