From 9943452ff9214bfb2b9f51dce9a448bcb9c3875b Mon Sep 17 00:00:00 2001 From: Matthew Rich Date: Wed, 16 Oct 2024 10:51:58 -0700 Subject: [PATCH] fix removal of SetURI on user/group --- internal/resource/common.go | 2 +- internal/resource/group.go | 4 +--- internal/resource/user.go | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/internal/resource/common.go b/internal/resource/common.go index f614229..6034549 100644 --- a/internal/resource/common.go +++ b/internal/resource/common.go @@ -82,7 +82,7 @@ func (c *Common) URIPath() string { } func (c *Common) URI() folio.URI { - slog.Info("Common.URI", "parsed", c.parsedURI, "debug", debug.Stack()) + slog.Info("Common.URI", "parsed", c.parsedURI) return folio.URI(c.parsedURI.String()) } diff --git a/internal/resource/group.go b/internal/resource/group.go index fc7717e..0433801 100644 --- a/internal/resource/group.go +++ b/internal/resource/group.go @@ -83,7 +83,6 @@ func FindSystemGroupType() GroupType { } func (g *Group) Init(u data.URIParser) error { - var initializeURI folio.URI if u == nil { u = folio.URI(g.URI()).Parse() } @@ -97,8 +96,7 @@ func (g *Group) Init(u data.URIParser) error { g.GroupType = GroupTypeGroupAdd } g.CreateCommand, g.ReadCommand, g.UpdateCommand, g.DeleteCommand = g.GroupType.NewCRUD() - initializeURI.SetURL(uri) - return g.SetURI(string(initializeURI)) + return g.SetParsedURI(u) } func (g *Group) NormalizePath() error { diff --git a/internal/resource/user.go b/internal/resource/user.go index 48b46b5..1040787 100644 --- a/internal/resource/user.go +++ b/internal/resource/user.go @@ -94,15 +94,13 @@ func FindSystemUserType() UserType { } func (u *User) Init(uri data.URIParser) error { - var initializeURI folio.URI if uri == nil { uri = folio.URI(u.URI()).Parse() } - initializeURI.SetURL(uri.URL()) u.Name = uri.URL().Hostname() u.UID = LookupUIDString(uri.URL().Hostname()) u.CreateCommand, u.ReadCommand, u.UpdateCommand, u.DeleteCommand = u.UserType.NewCRUD() - return u.SetURI(string(initializeURI)) + return u.SetParsedURI(uri) } func (u *User) NormalizePath() error {