diff --git a/internal/host/plugin/repository_host_catalog.go b/internal/host/plugin/repository_host_catalog.go index 109484338b..028dfb38b0 100644 --- a/internal/host/plugin/repository_host_catalog.go +++ b/internal/host/plugin/repository_host_catalog.go @@ -51,6 +51,7 @@ func normalizeCatalogAttributes(ctx context.Context, plgClient plgpb.HostPluginS }) switch { case err == nil: + // TODO: this should be updated to return these attributes rather than updating them in-place if ret.Attributes != nil { plgHc.Attrs = &pb.HostCatalog_Attributes{ Attributes: ret.Attributes, diff --git a/internal/plugin/loopback/storage.go b/internal/plugin/loopback/storage.go index e588933759..cd16dbe178 100644 --- a/internal/plugin/loopback/storage.go +++ b/internal/plugin/loopback/storage.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/storagebuckets" plgpb "github.com/hashicorp/boundary/sdk/pbs/plugin" + "github.com/hashicorp/go-secure-stdlib/parseutil" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/structpb" @@ -141,9 +142,15 @@ func (l *LoopbackStorage) normalizeStorageBucketData(ctx context.Context, req *p if req.GetAttributes() == nil { return nil, status.Errorf(codes.InvalidArgument, "%s: missing attributes", op) } + attrs := req.GetAttributes() + if endpoint, ok := attrs.GetFields()["endpoint_url"]; ok { + if endpoint, err := parseutil.NormalizeAddr(endpoint.GetStringValue()); err == nil { + attrs.Fields["endpoint_url"] = structpb.NewStringValue(endpoint) + } + } l.normalizations++ return &plgpb.NormalizeStorageBucketDataResponse{ - Attributes: req.GetAttributes(), + Attributes: attrs, }, nil }