{"id":13805807,"url":"https://github.com/phaneesh/dropwizard-maxmind-bundle","last_synced_at":"2025-12-24T23:55:15.452Z","repository":{"id":55574643,"uuid":"56960179","full_name":"phaneesh/dropwizard-maxmind-bundle","owner":"phaneesh","description":"A simple bundle for integrating MaxMind into dropwizard","archived":false,"fork":false,"pushed_at":"2020-12-21T12:59:46.000Z","size":36,"stargazers_count":6,"open_issues_count":4,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-18T22:30:56.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phaneesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-24T07:42:43.000Z","updated_at":"2020-07-02T02:38:43.000Z","dependencies_parsed_at":"2022-08-15T03:30:36.277Z","dependency_job_id":null,"html_url":"https://github.com/phaneesh/dropwizard-maxmind-bundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaneesh%2Fdropwizard-maxmind-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaneesh%2Fdropwizard-maxmind-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaneesh%2Fdropwizard-maxmind-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phaneesh%2Fdropwizard-maxmind-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phaneesh","download_url":"https://codeload.github.com/phaneesh/dropwizard-maxmind-bundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254031028,"owners_count":22002688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T01:01:05.073Z","updated_at":"2025-12-24T23:55:15.444Z","avatar_url":"https://github.com/phaneesh.png","language":"Java","funding_links":[],"categories":["Open Source"],"sub_categories":["Eclipse"],"readme":"# Dropwizard MaxMind Bundle [![Travis build status](https://travis-ci.org/phaneesh/dropwizard-maxmind-bundle.svg?branch=master)](https://travis-ci.org/phaneesh/dropwizard-maxmind-bundle)\n\nThis bundle adds MaxMind GeoIP2 support for dropwizard.\nThis bundle compiles only on Java 8.\n\n## Dependencies\n* Dropwizard 2.1.12\n\n* [GeoIP2 Java API](https://github.com/maxmind/GeoIP2-java)  \n\n## Usage\nThe bundle adds MaxMind GeoIP2 support for which makes it easier for geo ip information that is required by location aware services.\nThe bundle works with the free light version of MaxMind GeoIP2 database as well.\n\n### Build instructions\n  - Clone the source:\n\n        git clone github.com/phaneesh/dropwizard-maxmind-bundle\n\n  - Build\n\n        mvn install\n\n### Maven Dependency\nUse the following repository:\n```xml\n\u003crepository\u003e\n    \u003cid\u003eclojars\u003c/id\u003e\n    \u003cname\u003eClojars repository\u003c/name\u003e\n    \u003curl\u003ehttps://clojars.org/repo\u003c/url\u003e\n\u003c/repository\u003e\n```\nUse the following maven dependency:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.raven.dropwizard\u003c/groupId\u003e\n    \u003cartifactId\u003edropwizard-maxmind\u003c/artifactId\u003e\n    \u003cversion\u003e2.1.12-1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Using MaxMind bundle\n\n#### Configuration\n```yaml\nmaxmind:\n  databaseFilePath: /path/to/maxmind/database/file.mmdb\n  remoteIpHeader: \"CLIENT-IP\" #default is X-FORWARDED-FOR (when used behind a loadbalancer)\n  cacheTTL: 120 #In seconds, Default is 300 seconds\n  cacheMaxEntries: 102400 #Default is 10240\n  enterprise: true #default: false. Enable maxmind enterprise database mode\n  type: anonymous #If it is not a enterprise database; set the type of database that is being used. Supported: country, city, anonymous\n  maxMindContext: false #If you need MaxMindInfo injection into resource methods; set it to true  \n```\n\n#### Bootstrap\n```java\n    @Override\n    public void initialize(final Bootstrap...) {\n        bootstrap.addBundle(new MaxMindBundle() {\n            \n            public MaxMindConfig getMaxMindConfig(T configuration) {\n                ...\n            }\n        });\n    }\n```\n\n#### Headers stamped\n* X-MAXMIND-REQUEST-COUNTRY\n* X-MAXMIND-REQUEST-COUNTRY-ISO\n* X-MAXMIND-REQUEST-STATE\n* X-MAXMIND-REQUEST-STATE-ISO\n* X-MAXMIND-REQUEST-CITY\n* X-MAXMIND-REQUEST-POSTAL-CODE\n* X-MAXMIND-REQUEST-LATITUDE\n* X-MAXMIND-REQUEST-LONGITUDE\n* X-MAXMIND-REQUEST-LOCATION-ACCURACY\n* X-MAXMIND-REQUEST-USER-TYPE\n* X-MAXMIND-REQUEST-CONNECTION-TYPE\n* X-MAXMIND-REQUEST-ISP\n* X-MAXMIND-REQUEST-ANONYMOUS-IP\n* X-MAXMIND-REQUEST-ANONYMOUS-VPN\n* X-MAXMIND-REQUEST-TOR-NODE\n* X-MAXMIND-REQUEST-LEGAL-PROXY\n\n#### MaxMindContext in Resource\nUse MaxMindInfo which is much more convenient if you want easier access to all the stamped headers in a simple object model\n* Example\n\n```java \n@Produces({ MediaType.APPLICATION_JSON })\n@Consumes({ MediaType.APPLICATION_JSON })\n@Path(\"/\")\npublic class MaxMindResource {\n\n    @GET\n    public Response maxMindInfoApi(@MaxMindContext final MaxMindInfo maxMindInfo) {\n      // Do work and return something\n        return Response.status(OK).entity(maxMindInfo).build();\n    }\n} \n``` \n\n\nLICENSE\n-------\n\nCopyright 2016 Phaneesh Nagaraja \u003cphaneesh.n@gmail.com\u003e.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaneesh%2Fdropwizard-maxmind-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphaneesh%2Fdropwizard-maxmind-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphaneesh%2Fdropwizard-maxmind-bundle/lists"}