Documentation
¶
Index ¶
- Constants
- type CompCredStore
- func (ccs *CompCredStore) GetAllCompCreds() (map[string]CompCredentials, error)
- func (ccs *CompCredStore) GetCompCred(xname string) (CompCredentials, error)
- func (ccs *CompCredStore) GetCompCreds(xnames []string) (map[string]CompCredentials, error)
- func (ccs *CompCredStore) StoreCompCred(compCred CompCredentials) error
- type CompCredentials
Constants ¶
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.