internal/boundary: add GetResourceType to Resource

The resource type method is used to automatically
create refresh tokens from a resource when that
resource is the last item returned in a page.

This also renames the iam domain ResourceType method
to GetResourceType to align with the new method.
This commit is contained in:
Johan Brandhorst-Satzkorn committed 2024-01-05 07:43:19 -08:00
1 parent 5cded25c8d
commit 0d39456418
36 files changed
+184 -21

No files matched your search

+3 -1
View File
@@ -7,6 +7,7 @@ package boundary
import (
"github.com/hashicorp/boundary/internal/db/timestamp"
"github.com/hashicorp/boundary/internal/types/resource"
)
// An Entity is an object distinguished by its identity, rather than its
@@ -24,11 +25,12 @@ type Aggregate interface {
GetUpdateTime() *timestamp.Timestamp
}
// A Resource is an aggregate with a name and description.
// A Resource is an aggregate with a name, description, and resource type.
type Resource interface {
Aggregate
GetName() string
GetDescription() string
GetResourceType() resource.Type
}
// AuthzProtectedEntity is used by some functions (primarily