auth

package
v0.0.0-...-43c0173 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package auth provides common functionality for Terraform and Terraform plugins to authenticate with OpenStack.

It includes a wide array of features, such as flexible authentication, debugging, client creation, endpoint customization and more.

While this package is specific to Terraform, it can be used for any kind of Terraform feature: core, backend, and plugins.

Index

Constants

This section is empty.

Variables

View Source
var REDACT_HEADERS = []string{"x-auth-token", "x-auth-key", "x-service-token",
	"x-storage-token", "x-account-meta-temp-url-key", "x-account-meta-temp-url-key-2",
	"x-container-meta-temp-url-key", "x-container-meta-temp-url-key-2", "set-cookie",
	"x-subject-token"}

List of headers that need to be redacted

Functions

func FormatHeaders

func FormatHeaders(headers http.Header, seperator string) string

FormatHeaders processes a headers object plus a deliminator, returning a string

func RedactHeaders

func RedactHeaders(headers http.Header) (processedHeaders []string)

RedactHeaders processes a headers object, returning a redacted list

Types

type Config

type Config struct {
	CACertFile                  string
	ClientCertFile              string
	ClientKeyFile               string
	Cloud                       string
	DefaultDomain               string
	DomainID                    string
	DomainName                  string
	EndpointOverrides           map[string]interface{}
	EndpointType                string
	IdentityEndpoint            string
	Insecure                    *bool
	Password                    string
	ProjectDomainName           string
	ProjectDomainID             string
	Region                      string
	Swauth                      bool
	TenantID                    string
	TenantName                  string
	Token                       string
	UserDomainName              string
	UserDomainID                string
	Username                    string
	UserID                      string
	ApplicationCredentialID     string
	ApplicationCredentialName   string
	ApplicationCredentialSecret string
	UseOctavia                  bool
	MaxRetries                  int

	OsClient *gophercloud.ProviderClient
}

func (*Config) BlockStorageV1Client

func (c *Config) BlockStorageV1Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) BlockStorageV2Client

func (c *Config) BlockStorageV2Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) BlockStorageV3Client

func (c *Config) BlockStorageV3Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) ComputeV2Client

func (c *Config) ComputeV2Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) ContainerInfraV1Client

func (c *Config) ContainerInfraV1Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) DNSV2Client

func (c *Config) DNSV2Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) DatabaseV1Client

func (c *Config) DatabaseV1Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) IdentityV3Client

func (c *Config) IdentityV3Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) ImageV2Client

func (c *Config) ImageV2Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) LoadAndValidate

func (c *Config) LoadAndValidate() error

LoadAndValidate performs the authentication and initial configuration of an OpenStack Provider Client. This sets up the HTTP client and authenticates to an OpenStack cloud.

Individual Service Clients are created later in this file.

func (*Config) LoadBalancerV2Client

func (c *Config) LoadBalancerV2Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) NetworkingV2Client

func (c *Config) NetworkingV2Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) ObjectStorageV1Client

func (c *Config) ObjectStorageV1Client(region string) (*gophercloud.ServiceClient, error)

func (*Config) SharedfilesystemV2Client

func (c *Config) SharedfilesystemV2Client(region string) (*gophercloud.ServiceClient, error)

type LogRoundTripper

type LogRoundTripper struct {
	Rt         http.RoundTripper
	OsDebug    bool
	MaxRetries int
}

LogRoundTripper satisfies the http.RoundTripper interface and is used to customize the default http client 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