guardian / path-manager

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

validate path before saving #23

Closed akash1810 closed 6 years ago

akash1810 commented 6 years ago

We've seen some paths being created with whitespace, which isn't great, so explicitly reject invalid paths.

A valid path is one that's a hyphenated alphanumeric.

An invalid path:

Failure will cause flexible-api to return a 409 with response invalid-identifier, which is already handled by Composer here.

Its easier to view the diff without whitespace - https://github.com/guardian/path-manager/pull/23/files?w=1

akash1810 commented 6 years ago

cc @tomrf1