auth

package
v0.0.0-...-cc35533 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheKey

func CacheKey(ao gophercloud.AuthOptions, region, serviceClientType string, urlType gophercloud.Availability) string

CacheKey returns the cache key formed from the user's authentication credentials.

func Err

func Err(have map[string]commandoptions.Cred, want map[string]string, errMsg []string) error

Err returns the custom error to print when authentication fails.

func NewClient

func NewClient(c *cli.Context, serviceType string, logger *logrus.Logger, noCache bool, useServiceNet bool) (*gophercloud.ServiceClient, error)

NewClient creates and returns a Rackspace client for the given service.

Types

type Cache

type Cache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Cache represents a place to store user authentication credentials.

func (*Cache) SetValue

func (cache *Cache) SetValue(cacheKey string, cacheValue *CacheItem) error

SetValue writes the user's current provider client to the cache.

func (*Cache) Value

func (cache *Cache) Value(cacheKey string) (*CacheItem, error)

Value returns the cached value for the given key if it exists.

type CacheItem

type CacheItem struct {
	TokenID         string
	ServiceEndpoint string
}

CacheItem represents a single item in the cache.

type CredentialsResult

type CredentialsResult struct {
	AuthOpts *gophercloud.AuthOptions
	Region   string
	Have     map[string]commandoptions.Cred
	Want     map[string]string
}

CredentialsResult holds the information acquired from looking for authentication credentials.

func Credentials

func Credentials(c *cli.Context, logger *logrus.Logger) (*CredentialsResult, error)

Credentials determines the appropriate authentication method for the user. It returns a gophercloud.AuthOptions object and a region.

It will use command-line authentication parameters if available, then it will look for any unset parameters in the config file, and then finally in environment variables.

type LogRoundTripper

type LogRoundTripper struct {
	Logger *logrus.Logger
	// contains filtered or unexported fields
}

LogRoundTripper satisfies the http.RoundTripper interface and is used to customize the default Gophercloud RoundTripper to allow for logging.

func (*LogRoundTripper) RoundTrip

func (lrt *LogRoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip performs a round-trip HTTP request and logs relevant information about it.

Jump to

Keyboard shortcuts

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