auth

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2019 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AKSKOptionsFromEnv

func AKSKOptionsFromEnv() (aksk.AKSKOptions, error)

func TokenOptionsFromEnv

func TokenOptionsFromEnv() (token.TokenOptions, error)

TokenOptionsFromEnv fills out an token.TokenOptions structure with the settings found on the various OpenStack OS_* environment variables.

The following variables provide sources of truth: OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_TENANT_ID, and OS_TENANT_NAME.

Of these, OS_USERNAME, OS_PASSWORD, and OS_AUTH_URL must have settings, or an error will result. OS_TENANT_ID, OS_TENANT_NAME, OS_PROJECT_ID, and OS_PROJECT_NAME are optional.

OS_TENANT_ID and OS_TENANT_NAME are mutually exclusive to OS_PROJECT_ID and OS_PROJECT_NAME. If OS_PROJECT_ID and OS_PROJECT_NAME are set, they will still be referred as "tenant" in Gophercloud.

To use this function, first set the OS_* environment variables (for example, by sourcing an `openrc` file), then:

opts, err := openstack.TokenOptionsFromEnv()
provider, err := openstack.AuthenticatedClient(opts)

Types

type AuthOptionsProvider

type AuthOptionsProvider interface {
	GetIdentityEndpoint() string
	GetProjectId() string
	GetDomainId() string
}

AuthOptionsProvider presents the base of an auth options implementation

Directories

Path Synopsis
Package signer providers functions for sign http request before request cloud.
Package signer providers functions for sign http request before request cloud.
Package token providers functions for initial http request body before request cloud.
Package token providers functions for initial http request body before request cloud.

Jump to

Keyboard shortcuts

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