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

+6
View File
@@ -11,6 +11,7 @@ import (
"github.com/hashicorp/boundary/internal/auth/ldap/store"
"github.com/hashicorp/boundary/internal/errors"
"github.com/hashicorp/boundary/internal/oplog"
"github.com/hashicorp/boundary/internal/types/resource"
"google.golang.org/protobuf/proto"
)
@@ -112,6 +113,11 @@ func (am *AuthMethod) SetTableName(n string) {
am.tableName = n
}
// GetResourceType returns the resource type of the AuthMethod
func (am *AuthMethod) GetResourceType() resource.Type {
return resource.AuthMethod
}
// oplog will create oplog metadata for the AuthMethod.
func (am *AuthMethod) oplog(ctx context.Context, opType oplog.OpType) (oplog.Metadata, error) {
const op = "ldap.(AuthMethod).oplog"