credentials

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToFile added in v0.37.0

func ToFile(c Credentials) error

ToFile stores the provided credentials in the default file location.

Types

type Credentials

type Credentials struct {
	Username  string `yaml:"username"`
	AccessKey string `yaml:"accessKey"`
	Source    string `yaml:"-"`
}

Credentials contains a set of Username + AccessKey for SauceLabs.

func FromEnv

func FromEnv() Credentials

FromEnv reads the credentials from the user environment.

func FromFile

func FromFile() Credentials

FromFile reads the credentials that stored in the default file location.

func Get

func Get() Credentials

Get returns the configured credentials. Effectively a covenience wrapper around FromEnv, followed by a call to FromFile.

The lookup order is:

  1. Environment variables (see FromEnv)
  2. Credentials file (see FromFile)

func (*Credentials) IsEmpty

func (c *Credentials) IsEmpty() bool

IsEmpty checks whether the credentials, i.e. username and access key are not empty. Returns false if even one of the credentials is empty.

func (*Credentials) IsValid

func (c *Credentials) IsValid() bool

IsValid validates that the credentials are valid.

Jump to

Keyboard shortcuts

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