platform

package
v0.0.0-...-46d7da7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AWSCertificatePem is the official public RSA certificate for AWS
	AWSCertificatePem = `` /* 1146-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsClientImpl

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

AwsClientImpl is the implementation of AWS metadata client.

func NewAwsClientImpl

func NewAwsClientImpl(rootCert string) *AwsClientImpl

NewAwsClientImpl creates a new AwsClientImpl.

func (*AwsClientImpl) GetAgentCredential

func (ci *AwsClientImpl) GetAgentCredential() ([]byte, error)

GetAgentCredential retrieves the instance identity document as the agent credential used by node agent

func (*AwsClientImpl) GetCredentialType

func (ci *AwsClientImpl) GetCredentialType() string

GetCredentialType returns the credential type as "aws".

func (*AwsClientImpl) GetDialOptions

func (ci *AwsClientImpl) GetDialOptions() ([]grpc.DialOption, error)

GetDialOptions returns the GRPC dial options to connect to the CA.

func (*AwsClientImpl) GetServiceIdentity

func (ci *AwsClientImpl) GetServiceIdentity() (string, error)

GetServiceIdentity extracts service identity from userdata. This function should be pluggable for different AWS deployments in the future.

func (*AwsClientImpl) IsProperPlatform

func (ci *AwsClientImpl) IsProperPlatform() bool

IsProperPlatform returns whether the AWS platform client is available.

type Client

type Client interface {
	GetDialOptions() ([]grpc.DialOption, error)
	// Whether the node agent is running on the right platform, e.g., if gcpPlatformImpl should only
	// run on GCE.
	IsProperPlatform() bool
	// Get the service identity.
	GetServiceIdentity() (string, error)
	// Get node agent credential
	GetAgentCredential() ([]byte, error)
	// Get type of the credential
	GetCredentialType() string
}

Client is the interface for implementing the client to access platform metadata.

func NewClient

func NewClient(platform, rootCertFile, keyFile, certChainFile, caAddr string) (Client, error)

NewClient is the function to create implementations of the platform metadata client.

type GcpClientImpl

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

GcpClientImpl is the implementation of GCP metadata client.

func NewGcpClientImpl

func NewGcpClientImpl(rootCert, ca string) *GcpClientImpl

NewGcpClientImpl creates a new GcpClientImpl.

func (*GcpClientImpl) GetAgentCredential

func (ci *GcpClientImpl) GetAgentCredential() ([]byte, error)

GetAgentCredential returns the GCP JWT for the serivce account.

func (*GcpClientImpl) GetCredentialType

func (ci *GcpClientImpl) GetCredentialType() string

GetCredentialType returns the credential type as "gcp".

func (*GcpClientImpl) GetDialOptions

func (ci *GcpClientImpl) GetDialOptions() ([]grpc.DialOption, error)

GetDialOptions returns the GRPC dial options to connect to the CA.

func (*GcpClientImpl) GetServiceIdentity

func (ci *GcpClientImpl) GetServiceIdentity() (string, error)

GetServiceIdentity gets the identity of the GCE service.

func (*GcpClientImpl) IsProperPlatform

func (ci *GcpClientImpl) IsProperPlatform() bool

IsProperPlatform returns whether the client is on GCE.

type OnPremClientImpl

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

OnPremClientImpl is the implementation of on premise metadata client.

func NewOnPremClientImpl

func NewOnPremClientImpl(rootCert, key, certChain string) (*OnPremClientImpl, error)

NewOnPremClientImpl creates a new OnPremClientImpl.

func (*OnPremClientImpl) GetAgentCredential

func (ci *OnPremClientImpl) GetAgentCredential() ([]byte, error)

GetAgentCredential passes the certificate to control plane to authenticate

func (*OnPremClientImpl) GetCredentialType

func (ci *OnPremClientImpl) GetCredentialType() string

GetCredentialType returns "onprem".

func (*OnPremClientImpl) GetDialOptions

func (ci *OnPremClientImpl) GetDialOptions() ([]grpc.DialOption, error)

GetDialOptions returns the GRPC dial options to connect to the CA.

func (*OnPremClientImpl) GetServiceIdentity

func (ci *OnPremClientImpl) GetServiceIdentity() (string, error)

GetServiceIdentity gets the service account from the cert SAN field.

func (*OnPremClientImpl) IsProperPlatform

func (ci *OnPremClientImpl) IsProperPlatform() bool

IsProperPlatform returns whether the platform is on premise.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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