Commit Graph

6 Commits

Author SHA1 Message Date
Sparsh c0784b916c
fixed linting issues
Signed-off-by: Sparsh <sparsh.raj30@gmail.com>
2025-10-07 22:42:26 +05:30
Sparsh 812ece9471
feat: Add domain-based matching to skip-auth-route
Add support for domain-based authentication bypass using the
--skip-auth-route flag with domain=regex syntax. This allows users
to skip authentication for specific domains or domain patterns.

Changes:
 - Extended allowedRoute struct to support domain regex matching
 - Added domain=regex pattern parsing in buildRoutesAllowlist
 - Implemented isAllowedDomain function for domain validation
 - Updated validation logic to handle domain-based routes
 - Domain matching uses Host header (or X-Forwarded-Host)
 - Domain rules work alongside existing method and path rules

Example usage:
 --skip-auth-route=domain=api\.example\.com
 --skip-auth-route=domain=.*\.subdomain\.com
Testing:
 - Added unit tests for domain pattern parsing
 - Added integration tests with 7 test scenarios
 - Verified exact domain matching and wildcard patterns
 - Confirmed non-matching domains are properly denied

Signed-off-by: Sparsh <sparsh.raj30@gmail.com>
2025-10-07 21:28:02 +05:30
yudrywet 4fe0d5659b chore: fix function names in comment
Signed-off-by: yudrywet <yudeyao@yeah.net>
2024-09-15 09:34:15 +02:00
Segfault16 965fab422d
Add API route config (#1760)
* Add API route config

In addition to requests with Accept header `application/json` return 401 instead of 302 to login page on requests matching API paths regex.

* Update changelog

* Refactor

* Remove unnecessary comment

* Reorder checks

* Lint Api -> API

Co-authored-by: Sebastian Halder <sebastian.halder@boehringer-ingelheim.com>
2022-09-11 16:09:32 +01:00
Nick Meves b7b7ade7c4
Improve AllowedRoute test table formatting 2020-10-07 10:13:41 -07:00
Nick Meves 183cb124a4
Support HTTP method based allowlists 2020-10-07 10:13:40 -07:00