Address #131 review: unknown link action is unknown, typed views, one share shape
Build image / build-and-push (push) Successful in 13s

- public_link checks the action before the confirmation gate, so an unknown
  action is told so instead of being asked to confirm nothing in particular
  (the 4/4 finding).
- linkView is a struct like shareView; toShareView builds the five share
  results, and a fresh share is read back so it carries the person's name
  like every other path.
- PublicShareURL trims a trailing slash off a hand-built base URL.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
2026-08-23 02:21:04 -04:00
co-authored by Claude Fable 5
parent f985c264f8
commit 608ef7c58e
3 changed files with 56 additions and 32 deletions
+3 -1
View File
@@ -94,7 +94,9 @@ func (s *Service) EnablePublicShareLink(ctx context.Context, actorID, gardenID i
func (s *Service) PublicShareURL(token string) string {
path := "/g/" + token
if s.cfg != nil && s.cfg.BaseURL != "" {
return s.cfg.BaseURL + path
// config trims the trailing slash already; a Config built by hand
// (tests, an embedder) may not have.
return strings.TrimRight(s.cfg.BaseURL, "/") + path
}
return path
}