guardian / path-manager

Service that manages paths for a domain. Ensures they are unique etc.
2 stars 0 forks source link

new `isRemoved` flag and endpoint #39

Closed twrichards closed 4 years ago

twrichards commented 4 years ago

https://trello.com/c/eRxPU16A/451-support-deleting-alias-paths

In the 'legal' use cases of the Evolving URLs functionality, there are scenarios where we need to remove any public-facing trace of a URL (e.g. some contentious headline, that the original URL was formed from).

However we need to ensure that path can never be taken again, so we effectively need to flag it as deleted in path-manager, change the data-structure in composer to support this concept too, then filter out deleted aliasPaths in the aliasPaths list which goes off to CAPI (see https://github.com/guardian/flexible-content/pull/3641).

What does this change?

How to test

Easiest way to test is probably via the testing instructions in https://github.com/guardian/flexible-content/pull/3641 (as composer essentially proxies this new functionality).

To test the new functionality directly, checkout this branch and launch using sbt start then using Postman make a POST to https://pathmanager.local.dev-gutools.co.uk/paths?path=ALIAS_PATH (where ALIAS_PATH is a valid alias path already in path-manager - see https://github.com/guardian/path-manager/pull/33 for how to convert canonicals to alias paths) you should get back a full list of alias paths with the isRemoved property of the path you used for ALIAS_PATH marked accordingly.

How can we measure success?

Users with the 'Evolving URLs' permission in composer will be able to 'delete' previous URLs in legal scenarios (and then restore if 'deleted' by mistake).