azure

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// DefaultMSIResourceID is the default resource ID to use as the intended
	// audience of the MSI token. The current value is the service ID for the
	// Resource Manager API.
	DefaultMSIResourceID = "https://management.azure.com/"
)

Variables

This section is empty.

Functions

func FetchMSIToken

func FetchMSIToken(ctx context.Context, cl HTTPClient, resource string) (string, error)

Types

type ComputeMetadata

type ComputeMetadata struct {
	Name              string `json:"name"`
	SubscriptionID    string `json:"subscriptionId"`
	ResourceGroupName string `json:"resourceGroupName"`
}

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

type HTTPClientFunc

type HTTPClientFunc func(*http.Request) (*http.Response, error)

func (HTTPClientFunc) Do

func (fn HTTPClientFunc) Do(req *http.Request) (*http.Response, error)

type InstanceMetadata

type InstanceMetadata struct {
	Compute ComputeMetadata `json:"compute"`
}

func FetchInstanceMetadata

func FetchInstanceMetadata(ctx context.Context, cl HTTPClient) (*InstanceMetadata, error)

type MSIAttestationData

type MSIAttestationData struct {
	Token string `json:"token"`
}

type MSITokenClaims

type MSITokenClaims struct {
	jwt.Claims
	TenantID string `json:"tid,omitempty"`
}

func (*MSITokenClaims) AgentID

func (c *MSITokenClaims) AgentID(trustDomain string) string

Jump to

Keyboard shortcuts

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