{"id":23897486,"url":"https://github.com/babyblue94520/firewall","last_synced_at":"2026-05-14T18:33:12.210Z","repository":{"id":62166527,"uuid":"155938756","full_name":"babyblue94520/firewall","owner":"babyblue94520","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-05T07:26:03.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-13T18:02:59.537Z","etag":null,"topics":["firewall","java","security","spring-boot"],"latest_commit_sha":null,"homepage":"","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/babyblue94520.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-03T01:28:18.000Z","updated_at":"2023-05-12T16:52:49.000Z","dependencies_parsed_at":"2024-01-05T08:44:10.104Z","dependency_job_id":null,"html_url":"https://github.com/babyblue94520/firewall","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"c4bb598e49a141b001710adc8b13a8653c1c613e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/babyblue94520/firewall","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babyblue94520%2Ffirewall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babyblue94520%2Ffirewall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babyblue94520%2Ffirewall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babyblue94520%2Ffirewall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babyblue94520","download_url":"https://codeload.github.com/babyblue94520/firewall/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babyblue94520%2Ffirewall/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33037842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["firewall","java","security","spring-boot"],"created_at":"2025-01-04T17:16:10.756Z","updated_at":"2026-05-14T18:33:12.193Z","avatar_url":"https://github.com/babyblue94520.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firewall\n\n## Overview\n\n\n## Requirement\n\n* Spring Boot 2.3+\n* Java 8+\n\n## QuickStart\n\n1. Write rule in yml\n\n```yaml\nfirewall:\n  rule:\n\n  additional-rule:\n\n```\n\n2. Enable\n\n```java\n\nimport com.primestar.firewall.EnableFirewall;\n\n@EnableFirewall\npublic class Application {\n\n}\n```\n\n3. Implement Filter\n\n```java\nimport com.primestar.firewall.FirewallService;\nimport com.primestar.firewall.FirewallType;\n\n\npublic class DemoFilter implements Filter {\n    @Autowired\n    private FirewallService firewallService;\n    \n    @Override\n    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {\n        HttpServletRequest request = (HttpServletRequest) req;\n        HttpServletResponse response = (HttpServletResponse) res;\n\n        String path = request.getRequestURI();\n        String url = request.getRequestURL().toString();\n        String origin = request.getHeader(HttpHeaders.ORIGIN);\n        String clientIp = WebUtil.getClientIp(request);\n        String remoteIp = request.getRemoteAddr();\n\n        int type = firewallService.parse(path, url, origin, clientIp, remoteIp);\n    }\n}\n\n```\n\n## Advanced\n\n1. Add rule at runtime\n\n```java\n\nimport com.primestar.firewall.EnableFirewall;\nimport com.primestar.firewall.FirewallService;\nimport org.springframework.beans.factory.InitializingBean;\nimport org.springframework.beans.factory.annotation.Autowired;\nimport org.springframework.context.annotation.Configuration;\n\n@EnableFirewall\n@Configuration\npublic class CustomConfig implements InitializingBean {\n\n    @Autowired\n    private FirewallService firewallService;\n\n\n    @Override\n    public void afterPropertiesSet() throws Exception {\n\n        // add other rule\n        firewallService.getIgnorePath().add(\"\");\n    }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabyblue94520%2Ffirewall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabyblue94520%2Ffirewall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabyblue94520%2Ffirewall/lists"}