Applying Host Catalog comments to Projects (#105)

* NewService for the project service now returns a non pointer and an error.

* Replacing t.Fatal calls with require.NoError calls.

* Initialize empty slices following the recommended way.

* Don't inline the prefix strings when validating requests.

* Check error when cleaning up the test.

* Add check that update updates the time.

* Use google.golang.org/protobuf where possible instead of github.com/golang/protobuf.

* Shorten the validateX function names.

* Inline API responses.

* Change test cleanup error logging to t.Errorf.

* Remove unneeded creation of an extra project.

* Inline regex check for invalid id.

* Build the pb.Project inline when converting from db to wire proto.

* Change stored repos into repo creating functions.

* Using iam.TestScopes instead of creating them myself.

* Remove out of date comments.

* Update name to match go test naming standards.

* Adding project service comments.

* Using scopeType's new prefix method inside scope.go

* Setting test project's name and desc to default to pass tests.

* Change host catalog to project in test.

* Fixing merge errors.

* Fixing some more merge errors.

* Fix typo in comments.

* Fix typos in project_service.go.

* Update error indicating provided id and the expected prefix.

* Make the RepoFactory types in a common directory.
This commit is contained in:
Todd Knight authored and GitHub committed 2020-06-08 14:43:13 -07:00
1 parent b016498d96
commit 6804c98b0b
11 files changed
+321 -245

No files matched your search

+4 -3
View File
@@ -10,6 +10,7 @@ import (
"github.com/hashicorp/watchtower/internal/db"
"github.com/hashicorp/watchtower/internal/host/static"
"github.com/hashicorp/watchtower/internal/iam"
"github.com/hashicorp/watchtower/internal/servers/controller/common"
)
type Controller struct {
@@ -19,9 +20,9 @@ type Controller struct {
baseContext context.Context
baseCancel context.CancelFunc
// Repos
IamRepoFn func() (*iam.Repository, error)
StaticHostRepoFn func() (*static.Repository, error)
// Repo factory methods
IamRepoFn common.IamRepoFactory
StaticHostRepoFn common.StaticRepoFactory
}
func New(conf *Config) (*Controller, error) {