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

Fix pipelien

parent cf8073ae
Branches
Tags
1 merge request!68Release
......@@ -84,9 +84,17 @@ var rootCmd = &cobra.Command{
jww.WARN.Printf("Skipping scheduling signature verification set to %v ", viper.GetBool("skipVerification"))
// Extract private key
privKey, err := rsa.LoadPrivateKeyFromPem(p.Key)
if err != nil {
jww.FATAL.Panicf("Failed to load RSA private key: %v", err)
}
rngStreamGen := fastRNG.NewStreamGenerator(12, 1024, csprng.NewSystemRNG)
// Set up manager with the ability to contact permissioning
manager := io.NewManager(p.IO, &id.UDB, permCert, twilioManager,
bannedManager, storage, viper.GetBool("skipVerification"))
bannedManager, storage, viper.GetBool("skipVerification"), privKey, rngStreamGen)
hostParams := connect.GetDefaultHostParams()
hostParams.AuthEnabled = false
permHost, err := manager.Comms.AddHost(&id.Permissioning,
......
......@@ -32,18 +32,21 @@ type Manager struct {
Twilio *twilio.Manager
Banned *banned.Manager
skipVerification bool
RsaPrivateKey *rsa.PrivateKey
}
// NewManager creates a new UserDiscovery Manager given a set of Params.
func NewManager(p params.IO, id *id.ID, permissioningCert *rsa.PublicKey,
twilio *twilio.Manager, banned *banned.Manager,
storage *storage.Storage, skipVerification bool) *Manager {
storage *storage.Storage, skipVerification bool, key *rsa.PrivateKey, streamGen *fastRNG.StreamGenerator) *Manager {
m := &Manager{
Storage: storage,
PermissioningPublicKey: permissioningCert,
Twilio: twilio,
Banned: banned,
skipVerification: skipVerification,
RsaPrivateKey: key,
Rng: streamGen,
}
m.Comms = udb.StartServer(id, fmt.Sprintf("0.0.0.0:%s", p.Port),
newImplementation(m), p.Cert, p.Key)
......
......@@ -30,7 +30,7 @@ func TestNewManager(t *testing.T) {
t.Fatalf("Failed to construct ban manager: %v", err)
}
m := NewManager(p, id.NewIdFromString("zezima", id.User, t), nil, tm, bannedManager, store, false)
m := NewManager(p, id.NewIdFromString("zezima", id.User, t), nil, tm, bannedManager, store, false, nil, nil)
if m == nil || reflect.TypeOf(m) != reflect.TypeOf(&Manager{}) {
t.Errorf("Did not receive a manager")
}
......
......@@ -45,7 +45,7 @@ func TestValidateUsername(t *testing.T) {
t.Fatalf("Failed to construct ban manager: %v", err)
}
_, err = registerUser(registerMsg, cert, store, bannedManager)
_, err = registerUser(registerMsg, cert, store, bannedManager, false)
if err != nil {
t.Errorf("Failed happy path: %v", err)
}
......@@ -96,7 +96,7 @@ func TestValidateUsername_UsernameMismatch(t *testing.T) {
t.Fatalf("Failed to construct ban manager: %v", err)
}
_, err = registerUser(registerMsg, cert, store, bannedManager)
_, err = registerUser(registerMsg, cert, store, bannedManager, false)
if err != nil {
t.Errorf("Failed happy path: %v", err)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment