Skip to content
Snippets Groups Projects
Commit 994ee29a authored by Josh Brooks's avatar Josh Brooks
Browse files

Respond to MR comments

parent 12e9906d
No related branches found
No related tags found
3 merge requests!510Release,!325Support a single call for ud.NewOrLoad,!323Xx 4019/new or load alt ud
......@@ -128,9 +128,9 @@ func (e *E2e) GetContact() []byte {
}
// GetUdAddressFromNdf retrieve the User Discovery's network address fom the NDF.
func (e *E2e) GetUdAddressFromNdf() []byte {
return []byte(e.api.GetCmix().GetInstance().GetPartialNdf().
Get().UDB.Address)
func (e *E2e) GetUdAddressFromNdf() string {
return e.api.GetCmix().GetInstance().GetPartialNdf().
Get().UDB.Address
}
// GetUdCertFromNdf retrieves the User Discovery's TLS certificate from the NDF.
......
......@@ -120,15 +120,16 @@ type UdNetworkStatus interface {
// - networkValidationSig is a signature provided by the network (i.e. the client registrar).
// This may be nil, however UD may return an error in some cases (e.g. in a production level
// environment).
// - cert is the TLS certificate for the alternate UD server.
// - address is the IP address of the alternate UD server.
// - contactFile is the data within a marshalled contact.Contact.
// - cert is the TLS certificate for the UD server this call will connect with.
// - contactFile is the data within a marshalled contact.Contact. This represents the
// contact file of the server this call will connect with.
// - address is the IP address of the UD server this call will connect with.
//
// Returns
// - A Manager object which is registered to the specified alternate UD service.
func NewOrLoadUd(e2eID int, follower UdNetworkStatus,
username string, registrationValidationSignature,
cert, address, contactFile []byte) (
cert, contactFile []byte, address string) (
*UserDiscovery, error) {
// Get user from singleton
......@@ -145,7 +146,7 @@ func NewOrLoadUd(e2eID int, follower UdNetworkStatus,
// Build manager
u, err := ud.NewOrLoad(user.api, user.api.GetComms(),
UdNetworkStatusFn, username, registrationValidationSignature,
cert, address, contactFile)
cert, contactFile, address)
if err != nil {
return nil, err
}
......
......@@ -21,8 +21,8 @@ type alternateUd struct {
// user discovery service.
//
// To undo this operation, use UnsetAlternativeUserDiscovery.
func (m *Manager) setAlternateUserDiscovery(altCert, altAddress,
contactFile []byte) error {
func (m *Manager) setAlternateUserDiscovery(altCert,
contactFile []byte, altAddress string) error {
params := connect.GetDefaultHostParams()
params.AuthEnabled = false
......@@ -37,7 +37,7 @@ func (m *Manager) setAlternateUserDiscovery(altCert, altAddress,
}
// Add a new host and return it if it does not already exist
host, err := m.comms.AddHost(udID, string(altAddress),
host, err := m.comms.AddHost(udID, altAddress,
altCert, params)
if err != nil {
return errors.WithMessage(err, "User Discovery host object could "+
......
......@@ -58,14 +58,14 @@ type Manager struct {
// - networkValidationSig is a signature provided by the network (i.e. the client registrar). This may
// be nil, however UD may return an error in some cases (e.g. in a production level environment).
// - customCert is the TLS certificate for the alternate UD server.
// - customAddress is the IP address of the alternate UD server.
// - customContactFile is the data within a marshalled contact.Contact.
// - customAddress is the IP address of the alternate UD server.
//
// Returns
// - A Manager object which is registered to the specified alternate UD service.
func NewOrLoad(user udE2e, comms Comms, follower udNetworkStatus,
username string, networkValidationSig []byte,
customCert, customAddress, customContactFile []byte) (*Manager, error) {
username string, networkValidationSig,
customCert, customContactFile []byte, customAddress string) (*Manager, error) {
jww.INFO.Println("ud.NewOrLoad()")
......@@ -76,7 +76,7 @@ func NewOrLoad(user udE2e, comms Comms, follower udNetworkStatus,
}
// Set alternative user discovery
err = m.setAlternateUserDiscovery(customCert, customAddress, customContactFile)
err = m.setAlternateUserDiscovery(customCert, customContactFile, customAddress)
if err != nil {
return nil, err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment