credentials

package
v0.167.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileSource = "Configuration file"

ConfigFileSource indicates the credentials are retrieved from configuration file.

View Source
const EnvSource = "Environment variables"

EnvSource indicates the credentials are retrieved from environment variables.

Variables

View Source
var DefaultCredsPath = ""

DefaultCredsPath returns the default location of the credentials file. It's under the user's home directory, if defined, otherwise under the current working directory.

Functions

func FromEnv

func FromEnv() iam.Credentials

FromEnv reads the credentials from the user environment.

func FromFile

func FromFile() iam.Credentials

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

func Get

func Get() iam.Credentials

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

The lookup order is:

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

func ToFile added in v0.37.0

func ToFile(c iam.Credentials) error

ToFile stores the provided credentials in the default file location.

Types

This section is empty.

Jump to

Keyboard shortcuts

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