frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Link to project page by name and version

Open sephiroth-j opened this issue 5 years ago • 5 comments

support URLs of type projects/:name/:version #41

sephiroth-j avatar Nov 25 '20 22:11 sephiroth-j

Thanks for the PR.

All links including clicking on a component or vulnerability no longer work due to the the additional path in the URL.

Examples: http://localhost:8081/projects/components/8d037fa4-57cc-4fe9-a5ef-d21c6fb8c90a http://localhost:8081/projects/vulnerabilities/NVD/CVE-2010-5321

Both of these are invalid. I would recommend changing the logic when performing the name/version lookup that upon a successful lookup, to replace the /projects/name/version with /projects/uuid. That way, all existing logic to construct links continues to work.

stevespringett avatar Nov 28 '20 05:11 stevespringett

Well, the existing logic to construct links was the actual problem. I missed them because I was searching for references to the router but did not found them. Now the router is used to resolve all links by using the name of the route.

sephiroth-j avatar Nov 28 '20 16:11 sephiroth-j

@sephiroth-j, is this PR still something that you want to see merged?

If so, when resolving conflicts, remember that commits must now be signed. I think that DCO checks on PRs was enabled since you submitted this PR.

msymons avatar Feb 11 '23 22:02 msymons

@msymons , thanks for the reminder. I would like to know if named routes should not be used at all and the redirect approach should be used. The router with it's named routes has, for example, the benefit that query and path arguments gets url-encoded by default. Named routes can be maintained at a central place and there is not struggle with (wrong) relative paths when using the router with named routes. Depending on this decision, I would discard this PR and create a new one that just includes the redirect.

p.s. Relative paths are still error prone, see #417 . Same for url-encoding.

sephiroth-j avatar Feb 21 '23 20:02 sephiroth-j

One for @nscuro or @stevespringett to answer! :smile:

msymons avatar Feb 21 '23 20:02 msymons