server

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataResponse added in v1.6.0

type MetadataResponse struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

type NMIResponse

type NMIResponse struct {
	Token    msiResponse `json:"token"`
	ClientID string      `json:"clientid"`
}

NMIResponse is the response returned to caller

type Server

type Server struct {
	KubeClient                         k8s.Client
	NMIPort                            string
	MetadataIP                         string
	MetadataPort                       string
	NodeName                           string
	IPTableUpdateTimeIntervalInSeconds int
	MICNamespace                       string
	Initialized                        bool
	BlockInstanceMetadata              bool
	MetadataHeaderRequired             bool
	// TokenClient is client that fetches identities and tokens
	TokenClient nmi.TokenClient
	Reporter    *metrics.Reporter
}

Server encapsulates all of the parameters necessary for starting up the server. These can be set via command line.

func NewServer

func NewServer(micNamespace string, blockInstanceMetadata bool, metadataHeaderRequired bool) *Server

NewServer will create a new Server with default values.

func (*Server) Run

func (s *Server) Run() error

Run runs the specified Server.

type TokenRequest added in v1.6.2

type TokenRequest struct {
	// ClientID identifies, by Azure AD client ID, a specific identity to use
	// when authenticating to Azure AD. It is mutually exclusive with
	// MsiResourceID.
	// Example: 77788899-f67e-42e1-9a78-89985f6bff3e
	ClientID string

	// MsiResourceID identifies, by urlencoded ARM resource ID, a specific
	// identity to use when authenticating to Azure AD. It is mutually exclusive
	// with ClientID.
	// Example: /subscriptions/<subid>/resourcegroups/<resourcegroup>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<name>
	ResourceID string

	// Resource is the urlencoded URI of the resource for the requested AD token.
	// Example: https://vault.azure.net.
	Resource string
}

func (TokenRequest) ValidateResourceParamExists added in v1.6.2

func (r TokenRequest) ValidateResourceParamExists() bool

Jump to

Keyboard shortcuts

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