model

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const CredentialsGlobalKey = "global/ipmi"

CredentialsGlobalKey is the Vault key used to access MEDS global

credentials
View Source
const CredentialsKeyPrefix = "meds-cred"

CredentialsKeyPrefix is the base of the Vault key for credentials

This is the default and the actual one comes from values.yaml
View Source
const CredentialsSSHKey = "bmc-ssh-creds"

Vault Key used for BMC SSH key info

Variables

This section is empty.

Functions

This section is empty.

Types

type MedsCredStore

type MedsCredStore struct {
	CCPath string
	SS     sstorage.SecureStorage
}

A MedsCredStore holds the connection to a Vault and the base path

used to formulate keys

func NewMedsCredStore

func NewMedsCredStore(keyPath string, ss sstorage.SecureStorage) (mcs *MedsCredStore)

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

func (*MedsCredStore) FindBMCSSHCredentials

func (mcs *MedsCredStore) FindBMCSSHCredentials(xname string) (sshCreds MedsSSHCredentials, err error)

func (*MedsCredStore) FindGlobalCredentials

func (mcs *MedsCredStore) FindGlobalCredentials() (medsCred MedsCredentials, err error)

Fetch the global credentials for Mountain blade BMCs from Vault.

func (*MedsCredStore) StoreGlobalCredentials

func (mcs *MedsCredStore) StoreGlobalCredentials(medsCred MedsCredentials) (err error)

Store the global credentials for Mountain blade BMCs into Vault.

type MedsCredentials

type MedsCredentials struct {
	Username string `json:"Username"`
	Password string `json:"Password"`
}

A MedsCredentials represents a username/password pair

func (MedsCredentials) String

func (medsCred MedsCredentials) String() string

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

type MedsSSHCredentials

type MedsSSHCredentials struct {
	Username      string `json:"username"`
	Password      string `json:"password"`
	AuthorizedKey string `json:"authorizedkey"`
}

BMC SSH creds

Jump to

Keyboard shortcuts

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