warehouse icon indicating copy to clipboard operation
warehouse copied to clipboard

Fixes #4703 Implement API for obtaining prohibited names

Open zooba opened this issue 5 years ago • 6 comments

This is very much a work in progress for implementing #4703, but I wanted to get feedback on the direction as I go.

In particular, the API route can't (trivially) go under /api/prohibited_project_name because that's a lookup for a package by that name. I replaced the slash with an underscore so I could test it, but open to other ideas on where to put it.

At least in my dev environment, putting it at /admin/prohibited_project_name/json seems to work okay. But totally open to other suggestions.

zooba avatar Sep 09 '20 20:09 zooba

Ping @di

zooba avatar Sep 09 '20 20:09 zooba

Going to move it under the admin section where the existing route is, but leave it unauthenticated and just return the list as JSON.

zooba avatar Sep 09 '20 20:09 zooba

we really shouldn't place this under /admin as that is explicitly not cached.

ewdurbin avatar Sep 09 '20 20:09 ewdurbin

Speaking of caching, we'll want to instrument some way of purging this URL when a new project is prohibited or removed from the prohibited list.

ewdurbin avatar Sep 09 '20 20:09 ewdurbin

If we move it under a route that Fastly will cache, will they respect expiry headers? This is an information API, so there's really no harm in it being up to a day behind.

zooba avatar Sep 09 '20 20:09 zooba

Also, any suggestions/preferences for where to route it? Under /api/{project_name} can't work (unless we go ahead and ban the package name matching the API... 👀) None of the other existing paths looked like good options.

zooba avatar Sep 09 '20 20:09 zooba