{"id":22066084,"url":"https://github.com/pcpratheesh/ip-guard-middleware","last_synced_at":"2026-04-28T20:37:41.958Z","repository":{"id":188204253,"uuid":"678290713","full_name":"pcpratheesh/ip-guard-middleware","owner":"pcpratheesh","description":"IP access control middleware for Gin, echo and fiber web frameworks. This middleware enhances your application's security by allowing you to define a whitelist of permitted IP addresses while providing extended features for handling non-whitelisted IPs.","archived":false,"fork":false,"pushed_at":"2023-08-14T15:17:12.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T00:41:38.274Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pcpratheesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-14T07:57:18.000Z","updated_at":"2023-08-14T13:23:00.000Z","dependencies_parsed_at":"2023-08-14T18:14:49.262Z","dependency_job_id":null,"html_url":"https://github.com/pcpratheesh/ip-guard-middleware","commit_stats":null,"previous_names":["pcpratheesh/ip-gaurd-middleware","pcpratheesh/ip-guard-middleware"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pcpratheesh/ip-guard-middleware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2Fip-guard-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2Fip-guard-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2Fip-guard-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2Fip-guard-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pcpratheesh","download_url":"https://codeload.github.com/pcpratheesh/ip-guard-middleware/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2Fip-guard-middleware/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32399000,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-11-30T19:25:39.179Z","updated_at":"2026-04-28T20:37:41.932Z","avatar_url":"https://github.com/pcpratheesh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ip-guard-middleware\nIP access control middleware for Gin, echo and fiber web frameworks. This middleware enhances your application's security by allowing you to define a whitelist of permitted IP addresses while providing extended features for handling non-whitelisted IPs.\n\n## Installation\nTo install GoHealthWatch, use the following command:\n```\ngo get github.com/pcpratheesh/ip-guard-middleware/\n```\n\n## Usage\n### For Gin\n\n*Import the package*\n```go\n    import (\n        guard \"github.com/pcpratheesh/ip-guard-middleware/middleware/gin\"\n    )\n```\n\n*Initializing the options*\n```go\nvar opts = []options.Options{\n    options.WithWhiteListIPs([]string{\n        \"your-ip\",\n    }),\n}\n\n```\n\n*Custom fallback handler function*\n```go\nvar fallbackHandler = func(ctx *gin.Context, clientIP string) {\n\tctx.JSON(http.StatusForbidden, map[string]string{\n\t\t\"message\": \"Not allowed to access.\",\n\t})\n\tctx.Abort()\n\treturn\n}\n\n...\n\noptions.SetFallbackHandler(\n    options.GinFallbackHandler(fallbackHandler),\n)\n```\n\n## Examples\n- [Gin](example/gin/main.go)\n- [Echo](example/echo/main.go)\n- [Fiber](example/fiber/main.go)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcpratheesh%2Fip-guard-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpcpratheesh%2Fip-guard-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcpratheesh%2Fip-guard-middleware/lists"}