compcredentials

package module
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 3 Imported by: 14 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultCompCredPath = "hms-creds"

Variables

This section is empty.

Functions

This section is empty.

Types

type CompCredStore

type CompCredStore struct {
	CCPath string
	SS     sstorage.SecureStorage
}

func NewCompCredStore

func NewCompCredStore(keyPath string, ss sstorage.SecureStorage) *CompCredStore

Create a new CompCredStore struct that uses a SecureStorage backing store.

func (*CompCredStore) GetAllCompCreds

func (ccs *CompCredStore) GetAllCompCreds() (map[string]CompCredentials, error)

Get the credentials for all components in the secure store.

func (*CompCredStore) GetCompCred

func (ccs *CompCredStore) GetCompCred(xname string) (CompCredentials, error)

Get the credentials for a component specified by xname from the secure store.

func (*CompCredStore) GetCompCreds

func (ccs *CompCredStore) GetCompCreds(xnames []string) (map[string]CompCredentials, error)

Get the credentials for a list of components in the secure store.

func (*CompCredStore) StoreCompCred

func (ccs *CompCredStore) StoreCompCred(compCred CompCredentials) error

Store the credentials for a component in the secure store.

type CompCredentials

type CompCredentials struct {
	Xname        string `json:"xname"`
	URL          string `json:"url"`
	Username     string `json:"username"`
	Password     string `json:"password"`
	SNMPAuthPass string `json:"SNMPAuthPass,omitempty"`
	SNMPPrivPass string `json:"SNMPPrivPass,omitempty"`
}

func (CompCredentials) String

func (compCred CompCredentials) String() string

Due to the sensitive nature of the data in CompCredentials, make a custom String function to prevent passwords from being printed directly (accidentally) to output.

Jump to

Keyboard shortcuts

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