Documentation ¶
Overview ¶
Package credentials is a generated GoMock package.
Index ¶
- func AddDockerRepoCreds(t *testing.T, rc CVRemoteConfig, store storage.CredTable, ...)
- func BuildCredKey(credType string, acctName string) string
- func BuildCredPath(scType pb.SubCredType, AcctName string, ocyCredType pb.CredType, ...) string
- func GetToken(path string) (string, error)
- func GetVcsCreds(store storage.CredTable, repoFullName string, remoteConfig CVRemoteConfig, ...) (*pb.VCSCreds, error)
- func SetStoragePostgres(consulet *consul.Consulet, vaulty vault.Vaulty, dbName string, location string, ...) (err error)
- func TeardownVaultAndConsul(testvault net.Listener, testconsul *testutil.TestServer)
- func TestSetupConsul(t *testing.T) (*testutil.TestServer, string, int)
- func TestSetupVault(t *testing.T) (net.Listener, string)
- type AdminValidator
- type CVRemoteConfig
- type HealthyMaintain
- type HealthyMaintainer
- type InsecureCredStorage
- type MockCVRemoteConfig
- func (m *MockCVRemoteConfig) AddCreds(store storage.CredTable, anyCred pb.OcyCredder, overwriteOk bool) error
- func (m *MockCVRemoteConfig) AddSSHKey(path string, sshKeyFile []byte) error
- func (m *MockCVRemoteConfig) CheckSSHKeyExists(path string) error
- func (m *MockCVRemoteConfig) DeleteCred(store storage.CredTable, anyCred pb.OcyCredder) error
- func (m *MockCVRemoteConfig) EXPECT() *MockCVRemoteConfigMockRecorder
- func (m *MockCVRemoteConfig) GetAllCreds(store storage.CredTable, hideSecret bool) ([]pb.OcyCredder, error)
- func (m *MockCVRemoteConfig) GetConsul() consul.Consuletty
- func (m *MockCVRemoteConfig) GetCred(store storage.CredTable, subCredType pb.SubCredType, ...) (pb.OcyCredder, error)
- func (m *MockCVRemoteConfig) GetCredsBySubTypeAndAcct(store storage.CredTable, stype pb.SubCredType, accountName string, ...) ([]pb.OcyCredder, error)
- func (m *MockCVRemoteConfig) GetCredsByType(store storage.CredTable, ctype pb.CredType, hideSecret bool) ([]pb.OcyCredder, error)
- func (m *MockCVRemoteConfig) GetOcelotStorage() (storage.OcelotStorage, error)
- func (m *MockCVRemoteConfig) GetPassword(scType pb.SubCredType, acctName string, ocyCredType pb.CredType, ...) (string, error)
- func (m *MockCVRemoteConfig) GetStorageCreds(typ *storage.Dest) (*StorageCreds, error)
- func (m *MockCVRemoteConfig) GetStorageType() (storage.Dest, error)
- func (m *MockCVRemoteConfig) GetVault() vault.Vaulty
- func (m *MockCVRemoteConfig) Healthy() bool
- func (m *MockCVRemoteConfig) Reconnect() error
- func (m *MockCVRemoteConfig) SetConsul(consul consul.Consuletty)
- func (m *MockCVRemoteConfig) SetVault(vault vault.Vaulty)
- func (m *MockCVRemoteConfig) UpdateCreds(store storage.CredTable, anyCred pb.OcyCredder) error
- type MockCVRemoteConfigMockRecorder
- func (mr *MockCVRemoteConfigMockRecorder) AddCreds(store, anyCred, overwriteOk interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) AddSSHKey(path, sshKeyFile interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) CheckSSHKeyExists(path interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) DeleteCred(store, anyCred interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) GetAllCreds(store, hideSecret interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) GetConsul() *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) GetCred(store, subCredType, identifier, accountName, hideSecret interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) GetCredsBySubTypeAndAcct(store, stype, accountName, hideSecret interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) GetCredsByType(store, ctype, hideSecret interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) GetOcelotStorage() *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) GetPassword(scType, acctName, ocyCredType, identifier interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) GetStorageCreds(typ interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) GetStorageType() *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) GetVault() *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) Healthy() *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) Reconnect() *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) SetConsul(consul interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) SetVault(vault interface{}) *gomock.Call
- func (mr *MockCVRemoteConfigMockRecorder) UpdateCreds(store, anyCred interface{}) *gomock.Call
- type MockHealthyMaintainer
- type MockHealthyMaintainerMockRecorder
- type MockInsecureCredStorage
- func (m *MockInsecureCredStorage) AddCreds(store storage.CredTable, anyCred pb.OcyCredder, overwriteOk bool) error
- func (m *MockInsecureCredStorage) EXPECT() *MockInsecureCredStorageMockRecorder
- func (m *MockInsecureCredStorage) GetAllCreds(store storage.CredTable, hideSecret bool) ([]pb.OcyCredder, error)
- func (m *MockInsecureCredStorage) GetCred(store storage.CredTable, subCredType pb.SubCredType, ...) (pb.OcyCredder, error)
- func (m *MockInsecureCredStorage) GetCredsBySubTypeAndAcct(store storage.CredTable, stype pb.SubCredType, accountName string, ...) ([]pb.OcyCredder, error)
- func (m *MockInsecureCredStorage) GetCredsByType(store storage.CredTable, ctype pb.CredType, hideSecret bool) ([]pb.OcyCredder, error)
- func (m *MockInsecureCredStorage) UpdateCreds(store storage.CredTable, anyCred pb.OcyCredder) error
- type MockInsecureCredStorageMockRecorder
- func (mr *MockInsecureCredStorageMockRecorder) AddCreds(store, anyCred, overwriteOk interface{}) *gomock.Call
- func (mr *MockInsecureCredStorageMockRecorder) GetAllCreds(store, hideSecret interface{}) *gomock.Call
- func (mr *MockInsecureCredStorageMockRecorder) GetCred(store, subCredType, identifier, accountName, hideSecret interface{}) *gomock.Call
- func (mr *MockInsecureCredStorageMockRecorder) GetCredsBySubTypeAndAcct(store, stype, accountName, hideSecret interface{}) *gomock.Call
- func (mr *MockInsecureCredStorageMockRecorder) GetCredsByType(store, ctype, hideSecret interface{}) *gomock.Call
- func (mr *MockInsecureCredStorageMockRecorder) UpdateCreds(store, anyCred interface{}) *gomock.Call
- type MockStorageCred
- type MockStorageCredMockRecorder
- type RemoteConfig
- func (rc *RemoteConfig) AddCreds(store storage.CredTable, anyCred pb.OcyCredder, overwriteOk bool) (err error)
- func (rc *RemoteConfig) AddSSHKey(path string, sshKeyFile []byte) (err error)
- func (rc *RemoteConfig) CheckSSHKeyExists(path string) error
- func (rc *RemoteConfig) DeleteCred(store storage.CredTable, anyCred pb.OcyCredder) (err error)
- func (rc *RemoteConfig) GetAllCreds(store storage.CredTable, hideSecret bool) ([]pb.OcyCredder, error)
- func (rc *RemoteConfig) GetConsul() consul.Consuletty
- func (rc *RemoteConfig) GetCred(store storage.CredTable, subCredType pb.SubCredType, ...) (pb.OcyCredder, error)
- func (rc *RemoteConfig) GetCredsBySubTypeAndAcct(store storage.CredTable, stype pb.SubCredType, accountName string, ...) ([]pb.OcyCredder, error)
- func (rc *RemoteConfig) GetCredsByType(store storage.CredTable, ctype pb.CredType, hideSecret bool) ([]pb.OcyCredder, error)
- func (rc *RemoteConfig) GetOcelotStorage() (storage.OcelotStorage, error)
- func (rc *RemoteConfig) GetPassword(scType pb.SubCredType, acctName string, ocyCredType pb.CredType, ...) (string, error)
- func (rc *RemoteConfig) GetStorageCreds(typ *storage.Dest) (*StorageCreds, error)
- func (rc *RemoteConfig) GetStorageType() (storage.Dest, error)
- func (rc *RemoteConfig) GetVault() ocevault.Vaulty
- func (rc *RemoteConfig) Healthy() bool
- func (rc *RemoteConfig) Reconnect() error
- func (rc *RemoteConfig) SetConsul(consl consul.Consuletty)
- func (rc *RemoteConfig) SetVault(vault ocevault.Vaulty)
- func (rc *RemoteConfig) UpdateCreds(store storage.CredTable, anyCred pb.OcyCredder) (err error)
- type RemoteConfigCred
- type RepoValidator
- type StorageCred
- type StorageCreds
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDockerRepoCreds ¶
func BuildCredKey ¶
BuildCredKey returns the key for the map[string]RemoteConfigCred map that GetCredAt returns.
func BuildCredPath ¶
func BuildCredPath(scType pb.SubCredType, AcctName string, ocyCredType pb.CredType, identifier string) string
BuildCred path will return "<creds>/vcs|repo|k8s/<subCredType(string)>/<identifier>"
func GetToken ¶
GetToken will check for a vault token first in the environment variable VAULT_TOKEN. If not found at the env var, either the path given or the default path of /etc/vaulted/token will be searched to see if it exists. If it exists, its contents will be read and returned as the vault token. for kubernetes support
func GetVcsCreds ¶
func GetVcsCreds(store storage.CredTable, repoFullName string, remoteConfig CVRemoteConfig, credType pb.SubCredType) (*pb.VCSCreds, error)
GetVcsCreds will retrieve a VCSCred for account name / bitbucket vcs type
func SetStoragePostgres ¶
func SetStoragePostgres(consulet *consul.Consulet, vaulty vault.Vaulty, dbName string, location string, port string, username string, pw string, vaultEngine string, vaultRole string) (err error)
SetStoragePostgres Instantiates Consul and Vault instances with configuration values for postgresql server usage for static or dynamic credentials FIXME: vaulty is a borrowed value, so we should use as a reference
func TeardownVaultAndConsul ¶
func TeardownVaultAndConsul(testvault net.Listener, testconsul *testutil.TestServer)
func TestSetupConsul ¶
Types ¶
type AdminValidator ¶
type AdminValidator struct{}
validator for all admin related stuff
func GetValidator ¶
func GetValidator() *AdminValidator
func (AdminValidator) ValidateConfig ¶
func (adminValidator AdminValidator) ValidateConfig(adminCreds *pb.VCSCreds) error
validates config and returns json formatted error
type CVRemoteConfig ¶
type CVRemoteConfig interface { GetConsul() consul.Consuletty SetConsul(consul consul.Consuletty) GetVault() ocevault.Vaulty SetVault(vault ocevault.Vaulty) AddSSHKey(path string, sshKeyFile []byte) (err error) CheckSSHKeyExists(path string) error GetPassword(scType pb.SubCredType, acctName string, ocyCredType pb.CredType, identifier string) (string, error) DeleteCred(store storage.CredTable, anyCred pb.OcyCredder) (err error) InsecureCredStorage HealthyMaintainer StorageCred }
CVRemoteConfig is an abstraction for retrieving/setting creds for ocelot currently uses consul + vault
func GetInstance ¶
func GetInstance(consulHost string, consulPort int, token string) (CVRemoteConfig, error)
GetInstance returns a new instance of ConfigConsult. If consulHot and consulPort are empty, this will talk to consul using reasonable defaults (localhost:8500) FIXME: This condense consulHost and consulPort into a single connection string if token is an empty string, vault will be initialized with $VAULT_TOKEN
func TestSetupVaultAndConsul ¶
func TestSetupVaultAndConsul(t *testing.T) (CVRemoteConfig, net.Listener, *testutil.TestServer)
TestSetupVaultAndConsul Returns an initialized remoteconfig, Vault, and Consul instances. Caller is responsible for calling TeardownVaultAndConsul() to close the connections
type HealthyMaintain ¶
func NewHealthyMaintain ¶
func NewHealthyMaintain() *HealthyMaintain
func (*HealthyMaintain) Healthy ¶
func (h *HealthyMaintain) Healthy() bool
func (*HealthyMaintain) Reconnect ¶
func (h *HealthyMaintain) Reconnect() error
func (*HealthyMaintain) SetHealthy ¶
func (h *HealthyMaintain) SetHealthy()
func (*HealthyMaintain) SetSuccessfulReconnect ¶
func (h *HealthyMaintain) SetSuccessfulReconnect()
func (*HealthyMaintain) SetUnHealthy ¶
func (h *HealthyMaintain) SetUnHealthy()
func (*HealthyMaintain) SetUnSuccessfulReconnect ¶
func (h *HealthyMaintain) SetUnSuccessfulReconnect()
type HealthyMaintainer ¶
type InsecureCredStorage ¶
type InsecureCredStorage interface { GetCredsByType(store storage.CredTable, ctype pb.CredType, hideSecret bool) ([]pb.OcyCredder, error) GetAllCreds(store storage.CredTable, hideSecret bool) ([]pb.OcyCredder, error) GetCred(store storage.CredTable, subCredType pb.SubCredType, identifier, accountName string, hideSecret bool) (pb.OcyCredder, error) GetCredsBySubTypeAndAcct(store storage.CredTable, stype pb.SubCredType, accountName string, hideSecret bool) ([]pb.OcyCredder, error) AddCreds(store storage.CredTable, anyCred pb.OcyCredder, overwriteOk bool) (err error) UpdateCreds(store storage.CredTable, anyCred pb.OcyCredder) (err error) }
type MockCVRemoteConfig ¶
type MockCVRemoteConfig struct {
// contains filtered or unexported fields
}
MockCVRemoteConfig is a mock of CVRemoteConfig interface
func NewMockCVRemoteConfig ¶
func NewMockCVRemoteConfig(ctrl *gomock.Controller) *MockCVRemoteConfig
NewMockCVRemoteConfig creates a new mock instance
func (*MockCVRemoteConfig) AddCreds ¶
func (m *MockCVRemoteConfig) AddCreds(store storage.CredTable, anyCred pb.OcyCredder, overwriteOk bool) error
AddCreds mocks base method
func (*MockCVRemoteConfig) AddSSHKey ¶
func (m *MockCVRemoteConfig) AddSSHKey(path string, sshKeyFile []byte) error
AddSSHKey mocks base method
func (*MockCVRemoteConfig) CheckSSHKeyExists ¶
func (m *MockCVRemoteConfig) CheckSSHKeyExists(path string) error
CheckSSHKeyExists mocks base method
func (*MockCVRemoteConfig) DeleteCred ¶
func (m *MockCVRemoteConfig) DeleteCred(store storage.CredTable, anyCred pb.OcyCredder) error
DeleteCred mocks base method
func (*MockCVRemoteConfig) EXPECT ¶
func (m *MockCVRemoteConfig) EXPECT() *MockCVRemoteConfigMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockCVRemoteConfig) GetAllCreds ¶
func (m *MockCVRemoteConfig) GetAllCreds(store storage.CredTable, hideSecret bool) ([]pb.OcyCredder, error)
GetAllCreds mocks base method
func (*MockCVRemoteConfig) GetConsul ¶
func (m *MockCVRemoteConfig) GetConsul() consul.Consuletty
GetConsul mocks base method
func (*MockCVRemoteConfig) GetCred ¶
func (m *MockCVRemoteConfig) GetCred(store storage.CredTable, subCredType pb.SubCredType, identifier, accountName string, hideSecret bool) (pb.OcyCredder, error)
GetCred mocks base method
func (*MockCVRemoteConfig) GetCredsBySubTypeAndAcct ¶
func (m *MockCVRemoteConfig) GetCredsBySubTypeAndAcct(store storage.CredTable, stype pb.SubCredType, accountName string, hideSecret bool) ([]pb.OcyCredder, error)
GetCredsBySubTypeAndAcct mocks base method
func (*MockCVRemoteConfig) GetCredsByType ¶
func (m *MockCVRemoteConfig) GetCredsByType(store storage.CredTable, ctype pb.CredType, hideSecret bool) ([]pb.OcyCredder, error)
GetCredsByType mocks base method
func (*MockCVRemoteConfig) GetOcelotStorage ¶
func (m *MockCVRemoteConfig) GetOcelotStorage() (storage.OcelotStorage, error)
GetOcelotStorage mocks base method
func (*MockCVRemoteConfig) GetPassword ¶
func (m *MockCVRemoteConfig) GetPassword(scType pb.SubCredType, acctName string, ocyCredType pb.CredType, identifier string) (string, error)
GetPassword mocks base method
func (*MockCVRemoteConfig) GetStorageCreds ¶
func (m *MockCVRemoteConfig) GetStorageCreds(typ *storage.Dest) (*StorageCreds, error)
GetStorageCreds mocks base method
func (*MockCVRemoteConfig) GetStorageType ¶
func (m *MockCVRemoteConfig) GetStorageType() (storage.Dest, error)
GetStorageType mocks base method
func (*MockCVRemoteConfig) GetVault ¶
func (m *MockCVRemoteConfig) GetVault() vault.Vaulty
GetVault mocks base method
func (*MockCVRemoteConfig) Healthy ¶
func (m *MockCVRemoteConfig) Healthy() bool
Healthy mocks base method
func (*MockCVRemoteConfig) Reconnect ¶
func (m *MockCVRemoteConfig) Reconnect() error
Reconnect mocks base method
func (*MockCVRemoteConfig) SetConsul ¶
func (m *MockCVRemoteConfig) SetConsul(consul consul.Consuletty)
SetConsul mocks base method
func (*MockCVRemoteConfig) SetVault ¶
func (m *MockCVRemoteConfig) SetVault(vault vault.Vaulty)
SetVault mocks base method
func (*MockCVRemoteConfig) UpdateCreds ¶
func (m *MockCVRemoteConfig) UpdateCreds(store storage.CredTable, anyCred pb.OcyCredder) error
UpdateCreds mocks base method
type MockCVRemoteConfigMockRecorder ¶
type MockCVRemoteConfigMockRecorder struct {
// contains filtered or unexported fields
}
MockCVRemoteConfigMockRecorder is the mock recorder for MockCVRemoteConfig
func (*MockCVRemoteConfigMockRecorder) AddCreds ¶
func (mr *MockCVRemoteConfigMockRecorder) AddCreds(store, anyCred, overwriteOk interface{}) *gomock.Call
AddCreds indicates an expected call of AddCreds
func (*MockCVRemoteConfigMockRecorder) AddSSHKey ¶
func (mr *MockCVRemoteConfigMockRecorder) AddSSHKey(path, sshKeyFile interface{}) *gomock.Call
AddSSHKey indicates an expected call of AddSSHKey
func (*MockCVRemoteConfigMockRecorder) CheckSSHKeyExists ¶
func (mr *MockCVRemoteConfigMockRecorder) CheckSSHKeyExists(path interface{}) *gomock.Call
CheckSSHKeyExists indicates an expected call of CheckSSHKeyExists
func (*MockCVRemoteConfigMockRecorder) DeleteCred ¶
func (mr *MockCVRemoteConfigMockRecorder) DeleteCred(store, anyCred interface{}) *gomock.Call
DeleteCred indicates an expected call of DeleteCred
func (*MockCVRemoteConfigMockRecorder) GetAllCreds ¶
func (mr *MockCVRemoteConfigMockRecorder) GetAllCreds(store, hideSecret interface{}) *gomock.Call
GetAllCreds indicates an expected call of GetAllCreds
func (*MockCVRemoteConfigMockRecorder) GetConsul ¶
func (mr *MockCVRemoteConfigMockRecorder) GetConsul() *gomock.Call
GetConsul indicates an expected call of GetConsul
func (*MockCVRemoteConfigMockRecorder) GetCred ¶
func (mr *MockCVRemoteConfigMockRecorder) GetCred(store, subCredType, identifier, accountName, hideSecret interface{}) *gomock.Call
GetCred indicates an expected call of GetCred
func (*MockCVRemoteConfigMockRecorder) GetCredsBySubTypeAndAcct ¶
func (mr *MockCVRemoteConfigMockRecorder) GetCredsBySubTypeAndAcct(store, stype, accountName, hideSecret interface{}) *gomock.Call
GetCredsBySubTypeAndAcct indicates an expected call of GetCredsBySubTypeAndAcct
func (*MockCVRemoteConfigMockRecorder) GetCredsByType ¶
func (mr *MockCVRemoteConfigMockRecorder) GetCredsByType(store, ctype, hideSecret interface{}) *gomock.Call
GetCredsByType indicates an expected call of GetCredsByType
func (*MockCVRemoteConfigMockRecorder) GetOcelotStorage ¶
func (mr *MockCVRemoteConfigMockRecorder) GetOcelotStorage() *gomock.Call
GetOcelotStorage indicates an expected call of GetOcelotStorage
func (*MockCVRemoteConfigMockRecorder) GetPassword ¶
func (mr *MockCVRemoteConfigMockRecorder) GetPassword(scType, acctName, ocyCredType, identifier interface{}) *gomock.Call
GetPassword indicates an expected call of GetPassword
func (*MockCVRemoteConfigMockRecorder) GetStorageCreds ¶
func (mr *MockCVRemoteConfigMockRecorder) GetStorageCreds(typ interface{}) *gomock.Call
GetStorageCreds indicates an expected call of GetStorageCreds
func (*MockCVRemoteConfigMockRecorder) GetStorageType ¶
func (mr *MockCVRemoteConfigMockRecorder) GetStorageType() *gomock.Call
GetStorageType indicates an expected call of GetStorageType
func (*MockCVRemoteConfigMockRecorder) GetVault ¶
func (mr *MockCVRemoteConfigMockRecorder) GetVault() *gomock.Call
GetVault indicates an expected call of GetVault
func (*MockCVRemoteConfigMockRecorder) Healthy ¶
func (mr *MockCVRemoteConfigMockRecorder) Healthy() *gomock.Call
Healthy indicates an expected call of Healthy
func (*MockCVRemoteConfigMockRecorder) Reconnect ¶
func (mr *MockCVRemoteConfigMockRecorder) Reconnect() *gomock.Call
Reconnect indicates an expected call of Reconnect
func (*MockCVRemoteConfigMockRecorder) SetConsul ¶
func (mr *MockCVRemoteConfigMockRecorder) SetConsul(consul interface{}) *gomock.Call
SetConsul indicates an expected call of SetConsul
func (*MockCVRemoteConfigMockRecorder) SetVault ¶
func (mr *MockCVRemoteConfigMockRecorder) SetVault(vault interface{}) *gomock.Call
SetVault indicates an expected call of SetVault
func (*MockCVRemoteConfigMockRecorder) UpdateCreds ¶
func (mr *MockCVRemoteConfigMockRecorder) UpdateCreds(store, anyCred interface{}) *gomock.Call
UpdateCreds indicates an expected call of UpdateCreds
type MockHealthyMaintainer ¶
type MockHealthyMaintainer struct {
// contains filtered or unexported fields
}
MockHealthyMaintainer is a mock of HealthyMaintainer interface
func NewMockHealthyMaintainer ¶
func NewMockHealthyMaintainer(ctrl *gomock.Controller) *MockHealthyMaintainer
NewMockHealthyMaintainer creates a new mock instance
func (*MockHealthyMaintainer) EXPECT ¶
func (m *MockHealthyMaintainer) EXPECT() *MockHealthyMaintainerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockHealthyMaintainer) Healthy ¶
func (m *MockHealthyMaintainer) Healthy() bool
Healthy mocks base method
func (*MockHealthyMaintainer) Reconnect ¶
func (m *MockHealthyMaintainer) Reconnect() error
Reconnect mocks base method
type MockHealthyMaintainerMockRecorder ¶
type MockHealthyMaintainerMockRecorder struct {
// contains filtered or unexported fields
}
MockHealthyMaintainerMockRecorder is the mock recorder for MockHealthyMaintainer
func (*MockHealthyMaintainerMockRecorder) Healthy ¶
func (mr *MockHealthyMaintainerMockRecorder) Healthy() *gomock.Call
Healthy indicates an expected call of Healthy
func (*MockHealthyMaintainerMockRecorder) Reconnect ¶
func (mr *MockHealthyMaintainerMockRecorder) Reconnect() *gomock.Call
Reconnect indicates an expected call of Reconnect
type MockInsecureCredStorage ¶
type MockInsecureCredStorage struct {
// contains filtered or unexported fields
}
MockInsecureCredStorage is a mock of InsecureCredStorage interface
func NewMockInsecureCredStorage ¶
func NewMockInsecureCredStorage(ctrl *gomock.Controller) *MockInsecureCredStorage
NewMockInsecureCredStorage creates a new mock instance
func (*MockInsecureCredStorage) AddCreds ¶
func (m *MockInsecureCredStorage) AddCreds(store storage.CredTable, anyCred pb.OcyCredder, overwriteOk bool) error
AddCreds mocks base method
func (*MockInsecureCredStorage) EXPECT ¶
func (m *MockInsecureCredStorage) EXPECT() *MockInsecureCredStorageMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockInsecureCredStorage) GetAllCreds ¶
func (m *MockInsecureCredStorage) GetAllCreds(store storage.CredTable, hideSecret bool) ([]pb.OcyCredder, error)
GetAllCreds mocks base method
func (*MockInsecureCredStorage) GetCred ¶
func (m *MockInsecureCredStorage) GetCred(store storage.CredTable, subCredType pb.SubCredType, identifier, accountName string, hideSecret bool) (pb.OcyCredder, error)
GetCred mocks base method
func (*MockInsecureCredStorage) GetCredsBySubTypeAndAcct ¶
func (m *MockInsecureCredStorage) GetCredsBySubTypeAndAcct(store storage.CredTable, stype pb.SubCredType, accountName string, hideSecret bool) ([]pb.OcyCredder, error)
GetCredsBySubTypeAndAcct mocks base method
func (*MockInsecureCredStorage) GetCredsByType ¶
func (m *MockInsecureCredStorage) GetCredsByType(store storage.CredTable, ctype pb.CredType, hideSecret bool) ([]pb.OcyCredder, error)
GetCredsByType mocks base method
func (*MockInsecureCredStorage) UpdateCreds ¶
func (m *MockInsecureCredStorage) UpdateCreds(store storage.CredTable, anyCred pb.OcyCredder) error
UpdateCreds mocks base method
type MockInsecureCredStorageMockRecorder ¶
type MockInsecureCredStorageMockRecorder struct {
// contains filtered or unexported fields
}
MockInsecureCredStorageMockRecorder is the mock recorder for MockInsecureCredStorage
func (*MockInsecureCredStorageMockRecorder) AddCreds ¶
func (mr *MockInsecureCredStorageMockRecorder) AddCreds(store, anyCred, overwriteOk interface{}) *gomock.Call
AddCreds indicates an expected call of AddCreds
func (*MockInsecureCredStorageMockRecorder) GetAllCreds ¶
func (mr *MockInsecureCredStorageMockRecorder) GetAllCreds(store, hideSecret interface{}) *gomock.Call
GetAllCreds indicates an expected call of GetAllCreds
func (*MockInsecureCredStorageMockRecorder) GetCred ¶
func (mr *MockInsecureCredStorageMockRecorder) GetCred(store, subCredType, identifier, accountName, hideSecret interface{}) *gomock.Call
GetCred indicates an expected call of GetCred
func (*MockInsecureCredStorageMockRecorder) GetCredsBySubTypeAndAcct ¶
func (mr *MockInsecureCredStorageMockRecorder) GetCredsBySubTypeAndAcct(store, stype, accountName, hideSecret interface{}) *gomock.Call
GetCredsBySubTypeAndAcct indicates an expected call of GetCredsBySubTypeAndAcct
func (*MockInsecureCredStorageMockRecorder) GetCredsByType ¶
func (mr *MockInsecureCredStorageMockRecorder) GetCredsByType(store, ctype, hideSecret interface{}) *gomock.Call
GetCredsByType indicates an expected call of GetCredsByType
func (*MockInsecureCredStorageMockRecorder) UpdateCreds ¶
func (mr *MockInsecureCredStorageMockRecorder) UpdateCreds(store, anyCred interface{}) *gomock.Call
UpdateCreds indicates an expected call of UpdateCreds
type MockStorageCred ¶
type MockStorageCred struct {
// contains filtered or unexported fields
}
MockStorageCred is a mock of StorageCred interface
func NewMockStorageCred ¶
func NewMockStorageCred(ctrl *gomock.Controller) *MockStorageCred
NewMockStorageCred creates a new mock instance
func (*MockStorageCred) EXPECT ¶
func (m *MockStorageCred) EXPECT() *MockStorageCredMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockStorageCred) GetOcelotStorage ¶
func (m *MockStorageCred) GetOcelotStorage() (storage.OcelotStorage, error)
GetOcelotStorage mocks base method
func (*MockStorageCred) GetStorageCreds ¶
func (m *MockStorageCred) GetStorageCreds(typ *storage.Dest) (*StorageCreds, error)
GetStorageCreds mocks base method
func (*MockStorageCred) GetStorageType ¶
func (m *MockStorageCred) GetStorageType() (storage.Dest, error)
GetStorageType mocks base method
type MockStorageCredMockRecorder ¶
type MockStorageCredMockRecorder struct {
// contains filtered or unexported fields
}
MockStorageCredMockRecorder is the mock recorder for MockStorageCred
func (*MockStorageCredMockRecorder) GetOcelotStorage ¶
func (mr *MockStorageCredMockRecorder) GetOcelotStorage() *gomock.Call
GetOcelotStorage indicates an expected call of GetOcelotStorage
func (*MockStorageCredMockRecorder) GetStorageCreds ¶
func (mr *MockStorageCredMockRecorder) GetStorageCreds(typ interface{}) *gomock.Call
GetStorageCreds indicates an expected call of GetStorageCreds
func (*MockStorageCredMockRecorder) GetStorageType ¶
func (mr *MockStorageCredMockRecorder) GetStorageType() *gomock.Call
GetStorageType indicates an expected call of GetStorageType
type RemoteConfig ¶
type RemoteConfig struct { Consul consul.Consuletty Vault ocevault.Vaulty }
RemoteConfig returns a struct with client handlers for Consul and Vault. Mainly for passing around after authenticating
func (*RemoteConfig) AddCreds ¶
func (rc *RemoteConfig) AddCreds(store storage.CredTable, anyCred pb.OcyCredder, overwriteOk bool) (err error)
AddCreds adds repo integration creds to storage + vault
func (*RemoteConfig) AddSSHKey ¶
func (rc *RemoteConfig) AddSSHKey(path string, sshKeyFile []byte) (err error)
AddSSHKey adds repo ssh private key to vault at the usual vault path + /ssh
func (*RemoteConfig) CheckSSHKeyExists ¶
func (rc *RemoteConfig) CheckSSHKeyExists(path string) error
CheckSSHKeyExists returns a boolean indicating whether or not an ssh key has been uploaded
func (*RemoteConfig) DeleteCred ¶
func (rc *RemoteConfig) DeleteCred(store storage.CredTable, anyCred pb.OcyCredder) (err error)
func (*RemoteConfig) GetAllCreds ¶
func (rc *RemoteConfig) GetAllCreds(store storage.CredTable, hideSecret bool) ([]pb.OcyCredder, error)
func (*RemoteConfig) GetConsul ¶
func (rc *RemoteConfig) GetConsul() consul.Consuletty
GetConsul returns the local consul client handler
func (*RemoteConfig) GetCred ¶
func (rc *RemoteConfig) GetCred(store storage.CredTable, subCredType pb.SubCredType, identifier, accountName string, hideSecret bool) (pb.OcyCredder, error)
func (*RemoteConfig) GetCredsBySubTypeAndAcct ¶
func (rc *RemoteConfig) GetCredsBySubTypeAndAcct(store storage.CredTable, stype pb.SubCredType, accountName string, hideSecret bool) ([]pb.OcyCredder, error)
func (*RemoteConfig) GetCredsByType ¶
func (rc *RemoteConfig) GetCredsByType(store storage.CredTable, ctype pb.CredType, hideSecret bool) ([]pb.OcyCredder, error)
func (*RemoteConfig) GetOcelotStorage ¶
func (rc *RemoteConfig) GetOcelotStorage() (storage.OcelotStorage, error)
GetOcelotStorage instantiates the datastore based on Consul configuration for Ocelot. Opens the database connection for Postgres.
func (*RemoteConfig) GetPassword ¶
func (rc *RemoteConfig) GetPassword(scType pb.SubCredType, acctName string, ocyCredType pb.CredType, identifier string) (string, error)
GetPassword will return to you the vault password at specified path
func (*RemoteConfig) GetStorageCreds ¶
func (rc *RemoteConfig) GetStorageCreds(typ *storage.Dest) (*StorageCreds, error)
GetStorageCreds initializes datastore info based on the configured storage type in Consul FIXME: We're doing ourselves a disservice by forcing a user to pass in a *storage.Dest when we can handle this internally through rc
func (*RemoteConfig) GetStorageType ¶
func (rc *RemoteConfig) GetStorageType() (storage.Dest, error)
GetStorageType reads from consul at common.StorageType, and returns a handle for the configured storage.
func (*RemoteConfig) GetVault ¶
func (rc *RemoteConfig) GetVault() ocevault.Vaulty
GetVault returns the local vault client handler
func (*RemoteConfig) Healthy ¶
func (rc *RemoteConfig) Healthy() bool
func (*RemoteConfig) Reconnect ¶
func (rc *RemoteConfig) Reconnect() error
func (*RemoteConfig) SetConsul ¶
func (rc *RemoteConfig) SetConsul(consl consul.Consuletty)
SetConsul sets the local consul client handler
func (*RemoteConfig) SetVault ¶
func (rc *RemoteConfig) SetVault(vault ocevault.Vaulty)
SetVault sets the local vault client handler
func (*RemoteConfig) UpdateCreds ¶
func (rc *RemoteConfig) UpdateCreds(store storage.CredTable, anyCred pb.OcyCredder) (err error)
type RemoteConfigCred ¶
type RemoteConfigCred interface { GetClientSecret() string SetAcctNameAndType(name string, typ string) GetAcctName() string GetType() string SetSecret(string) SetAdditionalFields(key string, val string) AddAdditionalFields(consule *consul.Consulet, path string) error BuildCredPath(credType string, acctName string) string Spawn() RemoteConfigCred }
RemoteConfigCred is the interface that remoteConfig requires credential structs to adhere to to appropriately add things to consul and vault. Implementation can be seen in `admin/models/guideocelotmodels.go`.
type RepoValidator ¶
type RepoValidator struct{}
func GetRepoValidator ¶
func GetRepoValidator() *RepoValidator
func (RepoValidator) ValidateConfig ¶
func (RepoValidator) ValidateConfig(repoCreds *pb.RepoCreds) error
RepoValidator.ValidateConfig validates config and returns an error if it does not meet spec
type StorageCred ¶
type StorageCred interface { GetStorageCreds(typ *storage.Dest) (*StorageCreds, error) GetStorageType() (storage.Dest, error) GetOcelotStorage() (storage.OcelotStorage, error) }