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**
|
- **Authentication Middleware**
|
||||||
- Support for **JWT** with client authorization based on request results.
|
- Support for **JWT** with client authorization based on request results.
|
||||||
- **Basic-Auth** and **OAuth** authentication mechanisms.
|
- **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
|
### Monitoring and Performance
|
||||||
- **Logging**
|
- **Logging**
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ It's designed to be straightforward and efficient, offering a rich set of featur
|
|||||||
- **Authentication Middleware**
|
- **Authentication Middleware**
|
||||||
- Support for **JWT** with client authorization based on request results.
|
- Support for **JWT** with client authorization based on request results.
|
||||||
- **Basic-Auth** and **OAuth** authentication mechanisms.
|
- **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
|
### Monitoring and Performance
|
||||||
- **Logging**
|
- **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
|
title: Basic auth
|
||||||
layout: default
|
layout: default
|
||||||
parent: Middleware
|
parent: Middleware
|
||||||
nav_order: 3
|
nav_order: 4
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
title: JWT Middleware
|
title: JWT Middleware
|
||||||
layout: default
|
layout: default
|
||||||
parent: Middleware
|
parent: Middleware
|
||||||
nav_order: 4
|
nav_order: 5
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
title: OAuth auth
|
title: OAuth auth
|
||||||
layout: default
|
layout: default
|
||||||
parent: Middleware
|
parent: Middleware
|
||||||
nav_order: 5
|
nav_order: 6
|
||||||
---
|
---
|
||||||
|
|
||||||
# OAuth middleware
|
# OAuth middleware
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
title: Rate Limit
|
title: Rate Limiting
|
||||||
layout: default
|
layout: default
|
||||||
parent: Middleware
|
parent: Middleware
|
||||||
nav_order: 6
|
nav_order: 7
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ Example of rate limiting middleware
|
|||||||
```yaml
|
```yaml
|
||||||
middlewares:
|
middlewares:
|
||||||
- name: rate-limit
|
- name: rate-limit
|
||||||
type: ratelimit #or rateLimit
|
type: rateLimit #or ratelimit
|
||||||
paths:
|
paths:
|
||||||
- /*
|
- /*
|
||||||
rule:
|
rule:
|
||||||
|
|||||||
Reference in New Issue
Block a user