Account API handler for CRDL operations (#228)

This commit is contained in:
Todd Knight authored and GitHub committed 2020-08-05 10:19:55 -07:00
1 parent 2ca7e0b88e
commit e5ec1f48b2
22 files changed
+3777 -91

No files matched your search

@@ -7,6 +7,7 @@ import (
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/sdk/helper/mlock"
"github.com/hashicorp/watchtower/internal/auth/password"
"github.com/hashicorp/watchtower/internal/authtoken"
"github.com/hashicorp/watchtower/internal/db"
"github.com/hashicorp/watchtower/internal/host/static"
@@ -25,6 +26,8 @@ type Controller struct {
IamRepoFn common.IamRepoFactory
StaticHostRepoFn common.StaticRepoFactory
AuthTokenRepoFn common.AuthTokenRepoFactory
PasswordAuthRepoFn common.PasswordAuthRepoFactory
}
func New(conf *Config) (*Controller, error) {
@@ -66,6 +69,9 @@ func New(conf *Config) (*Controller, error) {
c.AuthTokenRepoFn = func() (*authtoken.Repository, error) {
return authtoken.NewRepository(dbase, dbase, c.conf.ControllerKMS)
}
c.PasswordAuthRepoFn = func() (*password.Repository, error) {
return password.NewRepository(dbase, dbase, c.conf.ControllerKMS)
}
return c, nil
}