whosonfirst / go-whosonfirst-pip-v2

An in-memory point-in-polygon (reverse geocoding) package for GeoJSON data, principally Who's On First data.
BSD 3-Clause "New" or "Revised" License
11 stars 5 forks source link

api-key support #26

Closed HIRANO-Satoshi closed 6 years ago

HIRANO-Satoshi commented 6 years ago

-mapzen-api-key is used to access the MapZen site.

To protect the pip-server from invalid access, we need the -api-key option. Though I wrote a code for it and it is working, there are some problems.

My modification works only on intersectHandler, because I modified it and I hesitate to add the modification to other handlers.

Ideally, handlers were chainable middlewares. If so, we could write apiKeyHandlerMiddleware or something like that and it might be applicable to any middlewares.

Another problem is api-key exchange. That could be resolved if we would use a reverse proxy and replace pip-servers periodically. The reverse proxy might be needed to replace pip-servers with pip-servers with updated data.

HIRANO-Satoshi commented 6 years ago

I did by myself. Thanks.