vpc

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMetadataServiceVersion = "2021-09-30"
	DefaultServerEndpoint         = "http://169.254.169.254"

	// headers
	MetadataFlavor = "Metadata-Flavor"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VPCAuthEndpoint              string
	InstanceIdentiyTokenEndpoint string
	IAMTokenEndpoint             string
	Version                      string
}

func DefaultConfig

func DefaultConfig(vpcAuthEndpoint string, apiVersion string) Config

type IAMAccessTokenRequest

type IAMAccessTokenRequest struct {
	AccessToken string `json:"access_token"`
	Body        *TrustedProfileByIdOrCRN
}

IAMAccessTokenRequest represents the request object for the `GetIAMAccessToken` operation. AccessToken - The instance identity token Body - The trusted profile ID/CRN represented as the `TrustedProfileByIdOrCRN` object

func NewIAMAccessTokenRequest

func NewIAMAccessTokenRequest(profileID string, profileCRN string, token string) (*IAMAccessTokenRequest, error)

NewIAMAccessTokenRequest builds the request body for the GetIAMAccessToken operation. The request body for this operation consists of either a trusted profile ID or CRN. If both a trusted profile ID and a trusted profile CRN are provided, then an error is returned.

type InstanceIdentityToken

type InstanceIdentityToken struct {
	// The access token
	AccessToken string `json:"access_token"`
	// The date and time that the access token was created
	CreatedAt string `json:"created_at"`
	// The date and time that the access token will expire
	ExpiresAt string `json:"expires_at"`
	// Time in seconds before the access token expires
	ExpiresIn int `json:"expires_in"`
}

InstanceIdentityToken describes the response body for the 'GetInstanceIdentityToken' operation.

type Interface

type Interface interface {
	GetInstanceIdentityToken() (*InstanceIdentityToken, error)
	GetIAMAccessToken(req *IAMAccessTokenRequest) (*iam.Token, error)
}

func NewClient

func NewClient(config Config, restClient *rest.Client) Interface

type TrustedProfileByIdOrCRN

type TrustedProfileByIdOrCRN struct {
	ID  string `json:"id"`
	CRN string `json:"crn"`
}

Jump to

Keyboard shortcuts

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