Create Alias Domain Object and Repo (#4275)
* Create alias domain object resource * Add paginated listing * fixing ratelimit related panics * Address reviewer comments * remove NewAlias value checks
This commit is contained in:
1 parent
7e2038bfcc
commit
e848e76b48
38 files changed
+3787
-5
No files matched your search
@@ -0,0 +1,32 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package aliases
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/boundary/internal/types/action"
|
||||
"github.com/hashicorp/boundary/internal/types/resource"
|
||||
)
|
||||
|
||||
var (
|
||||
// IdActions contains the set of actions that can be performed on
|
||||
// individual resources
|
||||
IdActions = action.NewActionSet(
|
||||
action.NoOp,
|
||||
action.Read,
|
||||
action.Update,
|
||||
action.Delete,
|
||||
)
|
||||
|
||||
// CollectionActions contains the set of actions that can be performed on
|
||||
// this collection
|
||||
CollectionActions = action.NewActionSet(
|
||||
action.Create,
|
||||
action.List,
|
||||
)
|
||||
)
|
||||
|
||||
func init() {
|
||||
// TODO: refactor to remove idActionsMap and CollectionActions package variables
|
||||
action.RegisterResource(resource.Alias, action.Union(IdActions), CollectionActions)
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/hashicorp/boundary/internal/daemon/controller/common"
|
||||
"github.com/hashicorp/boundary/internal/daemon/controller/common/scopeids"
|
||||
"github.com/hashicorp/boundary/internal/daemon/controller/handlers"
|
||||
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/aliases"
|
||||
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/authmethods"
|
||||
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/authtokens"
|
||||
"github.com/hashicorp/boundary/internal/daemon/controller/handlers/credentialstores"
|
||||
@@ -76,6 +77,7 @@ var (
|
||||
// TODO: get this from action registry
|
||||
scopeCollectionTypeMapMap = map[string]map[resource.Type]action.ActionSet{
|
||||
scope.Global.String(): {
|
||||
resource.Alias: aliases.CollectionActions,
|
||||
resource.AuthMethod: authmethods.CollectionActions,
|
||||
resource.StorageBucket: storage_buckets.CollectionActions,
|
||||
resource.AuthToken: authtokens.CollectionActions,
|
||||
|
||||
@@ -81,6 +81,12 @@ func createDefaultScopesRepoAndKms(t *testing.T) (*iam.Scope, *iam.Scope, func()
|
||||
}
|
||||
|
||||
var globalAuthorizedCollectionActions = map[string]*structpb.ListValue{
|
||||
"aliases": {
|
||||
Values: []*structpb.Value{
|
||||
structpb.NewStringValue("create"),
|
||||
structpb.NewStringValue("list"),
|
||||
},
|
||||
},
|
||||
"auth-methods": {
|
||||
Values: []*structpb.Value{
|
||||
structpb.NewStringValue("create"),
|
||||
|
||||
Reference in new issue
Block a user