compcredentials

package module
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 3 Imported by: 6

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