whosonfirst / go-whosonfirst-pip-v2

An in-memory point-in-polygon (reverse geocoding) package for GeoJSON data, principally Who's On First data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

api-key support

HIRANO-Satoshi opened this issue · comments

-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.

I did by myself. Thanks.