docs: add access policy middleware
This commit is contained in:
@@ -74,6 +74,9 @@ It's designed to be straightforward and efficient, offering a rich set of featur
|
||||
- **Authentication Middleware**
|
||||
- Support for **JWT** with client authorization based on request results.
|
||||
- **Basic-Auth** and **OAuth** authentication mechanisms.
|
||||
- **Access Policy Middleware**
|
||||
|
||||
The Access Policy middleware controls route access by either `allowing` or `denying` requests based on defined rules.
|
||||
|
||||
### Monitoring and Performance
|
||||
- **Logging**
|
||||
|
||||
@@ -48,6 +48,9 @@ It's designed to be straightforward and efficient, offering a rich set of featur
|
||||
- **Authentication Middleware**
|
||||
- Support for **JWT** with client authorization based on request results.
|
||||
- **Basic-Auth** and **OAuth** authentication mechanisms.
|
||||
- **Access Policy Middleware**
|
||||
|
||||
The Access Policy middleware controls route access by either `allowing` or `denying` requests based on defined rules.
|
||||
|
||||
### Monitoring and Performance
|
||||
- **Logging**
|
||||
|
||||
32
docs/middleware/access-policy.md
Normal file
32
docs/middleware/access-policy.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: Access Policy
|
||||
layout: default
|
||||
parent: Middleware
|
||||
nav_order: 3
|
||||
---
|
||||
|
||||
|
||||
### Access Policy Middleware
|
||||
The Access Policy middleware controls route access by either allowing or denying requests based on defined rules.
|
||||
It supports two actions: `ALLOW` and `DENY`.
|
||||
|
||||
### How It Works
|
||||
1. **Define an action:** Specify whether the middleware should `ALLOW` or `DENY` access.
|
||||
|
||||
2. **Set sourceRanges:** Provide a list of IP addresses or IP ranges to which the policy applies.
|
||||
|
||||
Requests originating from these sources will be evaluated according to the specified action.
|
||||
|
||||
#### Example Configuration
|
||||
Here’s an example of an Access Policy middleware configuration in YAML:
|
||||
|
||||
```yaml
|
||||
middlewares:
|
||||
- name: access-policy
|
||||
type: accessPolicy
|
||||
rule:
|
||||
action: DENY # Specify either DENY or ALLOW
|
||||
sourceRanges:
|
||||
- 192.168.1.1 # Single IP address
|
||||
- 172.18.0.0-172.18.0.10 # IP range
|
||||
```
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Basic auth
|
||||
layout: default
|
||||
parent: Middleware
|
||||
nav_order: 3
|
||||
nav_order: 4
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: JWT Middleware
|
||||
layout: default
|
||||
parent: Middleware
|
||||
nav_order: 4
|
||||
nav_order: 5
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: OAuth auth
|
||||
layout: default
|
||||
parent: Middleware
|
||||
nav_order: 5
|
||||
nav_order: 6
|
||||
---
|
||||
|
||||
# OAuth middleware
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
title: Rate Limit
|
||||
title: Rate Limiting
|
||||
layout: default
|
||||
parent: Middleware
|
||||
nav_order: 6
|
||||
nav_order: 7
|
||||
---
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Example of rate limiting middleware
|
||||
```yaml
|
||||
middlewares:
|
||||
- name: rate-limit
|
||||
type: ratelimit #or rateLimit
|
||||
type: rateLimit #or ratelimit
|
||||
paths:
|
||||
- /*
|
||||
rule:
|
||||
|
||||
Reference in New Issue
Block a user