Tie together the database-driven session handling with the worker and add relevant CLI comands (#370)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-09-19 00:18:17 -04:00
1 parent fd8ceb6cc4
commit 07a7e9750a
57 files changed
+2548 -826

No files matched your search

+5 -2
View File
@@ -15,6 +15,7 @@ import (
"github.com/hashicorp/boundary/internal/kms"
"github.com/hashicorp/boundary/internal/servers"
"github.com/hashicorp/boundary/internal/servers/controller/common"
"github.com/hashicorp/boundary/internal/session"
"github.com/hashicorp/boundary/internal/target"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/sdk/helper/base62"
@@ -35,7 +36,6 @@ type Controller struct {
// Used for testing
workerStatusUpdateTimes *sync.Map
jobMap *sync.Map
// Repo factory methods
AuthTokenRepoFn common.AuthTokenRepoFactory
@@ -44,6 +44,7 @@ type Controller struct {
ServersRepoFn common.ServersRepoFactory
StaticHostRepoFn common.StaticRepoFactory
TargetRepoFn common.TargetRepoFactory
SessionRepoFn common.SessionRepoFactory
kms *kms.Kms
@@ -55,7 +56,6 @@ func New(conf *Config) (*Controller, error) {
conf: conf,
logger: conf.Logger.Named("controller"),
workerStatusUpdateTimes: new(sync.Map),
jobMap: new(sync.Map),
}
c.started.Store(false)
@@ -125,6 +125,9 @@ func New(conf *Config) (*Controller, error) {
c.TargetRepoFn = func() (*target.Repository, error) {
return target.NewRepository(dbase, dbase, c.kms)
}
c.SessionRepoFn = func() (*session.Repository, error) {
return session.NewRepository(dbase, dbase, c.kms)
}
c.workerAuthCache = cache.New(0, 0)