-
Notifications
You must be signed in to change notification settings - Fork 0
/
gate-config.yml
81 lines (70 loc) · 1.43 KB
/
gate-config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
api_version: v1 #required
# Policies
# Global settings
settings: #required
base_path: /api
port: 3000
# Authentication configuration
authentication:
jwt:
secret: your_jwt_secret_key
# Authorization configuration
authorization:
roles:
- name: public
permissions: [read]
- name: user
permissions: [read, write]
- name: admin
permissions: [read, write, admin]
# Rate Limiting configuration
rate_limiting:
enabled: true
max_requests: 5000
interval: 1d
# Logging configuration
logging:
format: combined
log_level: debug
file:
enabled: true
path: /logs/api-gateway.log
# Caching configuration
caching:
client: redis
default_ttl: 1000
max_size: 1000
# Routes configuration
routes:
- path: /public
target: http://localhost:3003
methods: [GET]
authentication:
type: none
authorization:
roles: [public]
- path: /users
target: http://localhost:3001
methods: [GET, POST]
authentication:
type: none
# audience: user-api
authorization:
roles: [user]
- path: /
target: http://localhost:3001
methods: [GET]
authentication:
type: none
# audience: user-api
authorization:
roles: [user]
- path: /users/:id
target: http://user-service:3001
methods: [GET]
authentication:
type: jwt
audience: user-api
authorization:
roles: [admin]
# add more configurations as needed