azure

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 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/"
	PluginName           = "azure_msi"
)

Variables

View Source
var DefaultAgentPathTemplate = agentpathtemplate.MustParse("/{{ .PluginName }}/{{ .TenantID }}/{{ .PrincipalID }}")

DefaultAgentPathTemplate is the default text/template

Functions

func FetchMSIToken

func FetchMSIToken(cl HTTPClient, resource string) (string, error)

func MakeAgentID added in v1.5.0

func MakeAgentID(td spiffeid.TrustDomain, agentPathTemplate *agentpathtemplate.Template, claims *MSITokenClaims) (spiffeid.ID, 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(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"`
	PrincipalID string `json:"sub,omitempty"`
}

Jump to

Keyboard shortcuts

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