authentication

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineEnvironment

func DetermineEnvironment(name string) (*azure.Environment, error)

DetermineEnvironment determines what the Environment name is within the Azure SDK for Go and then returns the association environment, if it exists.

Types

type Builder

type Builder struct {
	// Core
	ClientID       string
	SubscriptionID string
	TenantID       string
	Environment    string

	// Azure CLI Parsing / CloudShell Auth
	SupportsAzureCliCloudShellParsing bool

	// Managed Service Identity Auth
	SupportsManagedServiceIdentity bool
	MsiEndpoint                    string

	// Service Principal (Client Cert) Auth
	SupportsClientCertAuth bool
	ClientCertPath         string
	ClientCertPassword     string

	// Service Principal (Client Secret) Auth
	SupportsClientSecretAuth bool
	ClientSecret             string
}

Builder supports all of the possible Authentication values and feature toggles required to build a working Config for Authentication purposes.

func (Builder) Build

func (b Builder) Build() (*Config, error)

Build takes the configuration from the Builder and builds up a validated Config for authenticating with Azure

type Config

type Config struct {
	ClientID                         string
	SubscriptionID                   string
	TenantID                         string
	Environment                      string
	AuthenticatedAsAServicePrincipal bool
	// contains filtered or unexported fields
}

Config is the configuration structure used to instantiate a new Azure management client.

func (Config) GetAuthorizationToken

func (c Config) GetAuthorizationToken(oauthConfig *adal.OAuthConfig, endpoint string) (*autorest.BearerAuthorizer, error)

GetAuthorizationToken returns an authorization token for the authentication method defined in the Config

Jump to

Keyboard shortcuts

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