common

package
v0.0.0-...-45ec842 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChassisCreds = ChassisCredentials{
		Creds:    make(map[string]*Credential),
		Profiles: make(map[string]*fishy_vault.SecretProperties),
	}
)
View Source
var (
	ErrInvalidCredential = errors.New("invalid credential")
)
View Source
var (
	IgnoredDevices = make(map[string]IgnoredDevice)
)

Functions

func BuildRequest

func BuildRequest(uri, host string) *retryablehttp.Request

func DoRequest

func DoRequest(client *retryablehttp.Client, req *retryablehttp.Request) (*http.Response, error)

func Fetch

func Fetch(uri, host, profile string, client *retryablehttp.Client) func() ([]byte, error)

func RemoveHost

func RemoveHost(w http.ResponseWriter, r *http.Request)

func TestConn

func TestConn(w http.ResponseWriter, r *http.Request)

Types

type ChassisCredentials

type ChassisCredentials struct {
	Creds          map[string]*Credential
	Profiles       map[string]*fishy_vault.SecretProperties
	DefaultProfile string
	Vault          *fishy_vault.Vault
	// contains filtered or unexported fields
}

func (*ChassisCredentials) Get

func (c *ChassisCredentials) Get(key string) (*Credential, bool)

func (*ChassisCredentials) GetCredentials

func (c *ChassisCredentials) GetCredentials(ctx context.Context, profile, target string) (*Credential, error)

func (*ChassisCredentials) Set

func (c *ChassisCredentials) Set(key string, value *Credential)

type Credential

type Credential struct {
	User string
	Pass string
}

type CredentialProfilesFlag

type CredentialProfilesFlag struct {
	Profiles []ProfileFlag `json:"profiles" yaml:"profiles"`
}

func CredentialProf

func CredentialProf(s *kingpin.FlagClause) (target *CredentialProfilesFlag)

func (*CredentialProfilesFlag) Set

func (cp *CredentialProfilesFlag) Set(value string) error

func (*CredentialProfilesFlag) String

func (c *CredentialProfilesFlag) String() string

type Handler

type Handler metricHandler

type IgnoredDevice

type IgnoredDevice struct {
	Name              string
	Endpoint          string
	Module            string
	CredentialProfile string
}

type ProfileFlag

type ProfileFlag struct {
	Name          string `json:"name" yaml:"name"`
	MountPath     string `json:"mountPath" yaml:"mountPath"`
	Path          string `json:"path" yaml:"path"`
	UserField     string `json:"userField,omitempty" yaml:"userField,omitempty"`
	PasswordField string `json:"passwordField" yaml:"passwordField"`
	SecretName    string `json:"secretName,omitempty" yaml:"secretName,omitempty"`
	UserName      string `json:"userName,omitempty" yaml:"userName,omitempty"`
}

Jump to

Keyboard shortcuts

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