auth

package
v0.10.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientTokenName       = ".token"
	ClientCertName        = "wssd.pem"
	ClientTokenPath       = "WSSD_CLIENT_TOKEN"
	WssdConfigPath        = "WSSD_CONFIG_PATH"
	DefaultWSSDFolder     = ".wssd"
	AccessFileDefaultName = "cloudconfig"
	ServerName            = "ServerName"
)

Variables

This section is empty.

Functions

func AccessFileToTls

func AccessFileToTls(accessFile WssdConfig) ([]byte, tls.Certificate, error)

func GetWssdConfigLocation

func GetWssdConfigLocation() string

func PrintAccessFile

func PrintAccessFile(accessFile WssdConfig) error

func SaveToken

func SaveToken(tokenStr string) error

func TransportCredentialsFromFile

func TransportCredentialsFromFile(wssdConfigLocation string, server string) credentials.TransportCredentials

func TransportCredentialsFromNode

func TransportCredentialsFromNode(tlsCert tls.Certificate, serverCertificate []byte, server string) credentials.TransportCredentials

Types

type Authorizer

type Authorizer interface {
	WithTransportAuthorization() credentials.TransportCredentials
	WithRPCAuthorization() credentials.PerRPCCredentials
}

func NewAuthorizerForAuth

func NewAuthorizerForAuth(tokenString string, certificate string, server string) (Authorizer, error)

func NewAuthorizerFromEnvironment

func NewAuthorizerFromEnvironment(serverName string) (Authorizer, error)

func NewAuthorizerFromInput

func NewAuthorizerFromInput(tlsCert tls.Certificate, serverCertificate []byte, server string) (Authorizer, error)

type BearerAuthorizer

type BearerAuthorizer struct {
	// contains filtered or unexported fields
}

BearerAuthorizer implements the bearer authorization

func NewBearerAuthorizer

NewBearerAuthorizer crates a BearerAuthorizer using the given token provider

func (*BearerAuthorizer) WithRPCAuthorization

func (ba *BearerAuthorizer) WithRPCAuthorization() credentials.PerRPCCredentials

func (*BearerAuthorizer) WithTransportAuthorization

func (ba *BearerAuthorizer) WithTransportAuthorization() credentials.TransportCredentials

type EnvironmentSettings

type EnvironmentSettings struct {
	Values map[string]string
}

EnvironmentSettings contains the available authentication settings.

func GetSettingsFromEnvironment

func GetSettingsFromEnvironment(serverName string) (s EnvironmentSettings, err error)

func (EnvironmentSettings) GetAuthorizer

func (settings EnvironmentSettings) GetAuthorizer() (Authorizer, error)

func (EnvironmentSettings) GetManagedIdentityConfig

func (settings EnvironmentSettings) GetManagedIdentityConfig() ManagedIdentityConfig

type JwtTokenProvider

type JwtTokenProvider struct {
	RawData string `json:"rawdata"`
}

func TokenProviderFromFile

func TokenProviderFromFile(tokenLocation string) JwtTokenProvider

func (JwtTokenProvider) GetRequestMetadata

func (c JwtTokenProvider) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

func (JwtTokenProvider) RequireTransportSecurity

func (c JwtTokenProvider) RequireTransportSecurity() bool

type LoginConfig

type LoginConfig struct {
	Name        string
	Token       string
	Certificate string
}

type ManagedIdentityConfig

type ManagedIdentityConfig struct {
	ClientTokenPath string
	WssdConfigPath  string
	ServerName      string
}

func (ManagedIdentityConfig) Authorizer

func (mc ManagedIdentityConfig) Authorizer() (Authorizer, error)

type WssdConfig

type WssdConfig struct {
	CloudCertificate  string
	ClientCertificate string
	ClientKey         string
}

func GenerateClientKey

func GenerateClientKey(loginconfig LoginConfig) ([]byte, WssdConfig, error)

Jump to

Keyboard shortcuts

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