secret

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package secret provides a way to read user credentials.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidSecret is returned when the secret is invalid.
	ErrInvalidSecret = errors.New("invalid secret")
)

Functions

func ReadCredentialFile

func ReadCredentialFile(path string) (api.SavedCredentials, error)

ReadCredentialFile reads the credentials from a file.

Types

type Reader

type Reader struct {
	FilePath string
}

Reader is a secret reader from a file.

func NewReader

func NewReader(filePath string) *Reader

NewReader creates a new secret reader.

func (*Reader) Read

func (s *Reader) Read() (api.SavedCredentials, error)

Read reads the username and password from the file.

type Static

type Static struct {
	api.SavedCredentials
}

Static is a static user password reader.

func (Static) Read

func (u Static) Read() (api.SavedCredentials, error)

Read returns the email and password.

type UserPasswordFromEnv

type UserPasswordFromEnv struct{}

UserPasswordFromEnv is a user password reader from the environment.

func (UserPasswordFromEnv) Read

Read returns the email and password from the environment.

Jump to

Keyboard shortcuts

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