Subtype Id registration moved to its own package (#1416)
* Allow repo packages to register subtypes and id prefixes. * Refactor out request authentication logic to a new package as a sibling to handler.
This commit is contained in:
1 parent
ab6f3eaeb4
commit
10e8aeae4b
62 files changed
+603
-597
No files matched your search
@@ -3,13 +3,23 @@ package static
|
||||
import (
|
||||
"github.com/hashicorp/boundary/internal/db"
|
||||
"github.com/hashicorp/boundary/internal/errors"
|
||||
"github.com/hashicorp/boundary/internal/host"
|
||||
"github.com/hashicorp/boundary/internal/types/subtypes"
|
||||
)
|
||||
|
||||
func init() {
|
||||
if err := host.Register(Subtype, HostCatalogPrefix, HostSetPrefix, HostPrefix); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// PublicId prefixes for the resources in the static package.
|
||||
const (
|
||||
HostCatalogPrefix = "hcst"
|
||||
HostSetPrefix = "hsst"
|
||||
HostPrefix = "hst"
|
||||
|
||||
Subtype = subtypes.Subtype("static")
|
||||
)
|
||||
|
||||
func newHostCatalogId() (string, error) {
|
||||
|
||||
Reference in new issue
Block a user