Initial commit: OAuth 2.0 인증 시스템 with APISIX API Gateway
- FastAPI 백엔드 + MongoDB + Redis 구성 - React + Vite + TypeScript + shadcn/ui 프론트엔드 - Apache APISIX API Gateway 통합 - Docker Compose 기반 개발 환경 - 3단계 권한 체계 (System Admin, Group Admin, User) - 동적 테마 지원 - 환경별 설정 (dev/vei/prod) 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
30
apisix/apisix-dashboard.yaml
Normal file
30
apisix/apisix-dashboard.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
conf:
|
||||
listen:
|
||||
host: 0.0.0.0
|
||||
port: 9000
|
||||
etcd:
|
||||
endpoints:
|
||||
- etcd:2379
|
||||
prefix: /apisix
|
||||
mtls:
|
||||
cert: ""
|
||||
cert_key: ""
|
||||
verify: false
|
||||
log:
|
||||
error_log:
|
||||
level: warn
|
||||
file_path: logs/error.log
|
||||
access_log:
|
||||
file_path: logs/access.log
|
||||
|
||||
authentication:
|
||||
secret: secret
|
||||
expire_time: 3600
|
||||
users:
|
||||
- username: admin
|
||||
password: admin123
|
||||
- username: user
|
||||
password: user123
|
||||
|
||||
oidc:
|
||||
enabled: false
|
||||
72
apisix/config.yaml
Normal file
72
apisix/config.yaml
Normal file
@ -0,0 +1,72 @@
|
||||
apisix:
|
||||
node_listen: 9080
|
||||
enable_ipv6: false
|
||||
enable_control: true
|
||||
control:
|
||||
ip: "0.0.0.0"
|
||||
port: 9092
|
||||
|
||||
deployment:
|
||||
admin:
|
||||
allow_admin:
|
||||
- 0.0.0.0/0
|
||||
admin_key:
|
||||
- name: "admin"
|
||||
key: edd1c9f034335f136f87ad84b625c8f1
|
||||
role: admin
|
||||
- name: "viewer"
|
||||
key: 4054f7cf07e344346cd3f287985e76a2
|
||||
role: viewer
|
||||
etcd:
|
||||
host:
|
||||
- "http://etcd:2379"
|
||||
prefix: "/apisix"
|
||||
timeout: 30
|
||||
|
||||
plugin_attr:
|
||||
prometheus:
|
||||
export_addr:
|
||||
ip: "0.0.0.0"
|
||||
port: 9091
|
||||
|
||||
plugins:
|
||||
- api-breaker
|
||||
- authz-keycloak
|
||||
- basic-auth
|
||||
- batch-requests
|
||||
- consumer-restriction
|
||||
- cors
|
||||
- echo
|
||||
- fault-injection
|
||||
- grpc-transcode
|
||||
- hmac-auth
|
||||
- http-logger
|
||||
- ip-restriction
|
||||
- jwt-auth
|
||||
- kafka-logger
|
||||
- key-auth
|
||||
- limit-conn
|
||||
- limit-count
|
||||
- limit-req
|
||||
- node-status
|
||||
- oauth
|
||||
- prometheus
|
||||
- proxy-cache
|
||||
- proxy-mirror
|
||||
- proxy-rewrite
|
||||
- redirect
|
||||
- referer-restriction
|
||||
- request-id
|
||||
- request-validation
|
||||
- response-rewrite
|
||||
- serverless-post-function
|
||||
- serverless-pre-function
|
||||
- sls-logger
|
||||
- syslog
|
||||
- tcp-logger
|
||||
- udp-logger
|
||||
- uri-blocker
|
||||
- wolf-rbac
|
||||
- zipkin
|
||||
- server-info
|
||||
- traffic-split
|
||||
119
apisix/routes.yaml
Normal file
119
apisix/routes.yaml
Normal file
@ -0,0 +1,119 @@
|
||||
routes:
|
||||
- uri: /api/v1/auth/*
|
||||
name: auth-service
|
||||
upstream:
|
||||
type: roundrobin
|
||||
nodes:
|
||||
backend:8000: 1
|
||||
plugins:
|
||||
cors:
|
||||
allow_origins: "*"
|
||||
allow_methods: "GET,POST,PUT,DELETE,OPTIONS"
|
||||
allow_headers: "*"
|
||||
expose_headers: "*"
|
||||
limit-req:
|
||||
rate: 10
|
||||
burst: 20
|
||||
rejected_code: 429
|
||||
request-id:
|
||||
header_name: "X-Request-Id"
|
||||
include_in_response: true
|
||||
|
||||
- uri: /api/v1/users/*
|
||||
name: user-service
|
||||
upstream:
|
||||
type: roundrobin
|
||||
nodes:
|
||||
backend:8000: 1
|
||||
plugins:
|
||||
jwt-auth:
|
||||
key: "user-key"
|
||||
secret: "my-secret-key"
|
||||
cors:
|
||||
allow_origins: "*"
|
||||
allow_methods: "GET,POST,PUT,DELETE,OPTIONS"
|
||||
allow_headers: "*"
|
||||
expose_headers: "*"
|
||||
limit-req:
|
||||
rate: 100
|
||||
burst: 50
|
||||
rejected_code: 429
|
||||
|
||||
- uri: /api/v1/applications/*
|
||||
name: application-service
|
||||
upstream:
|
||||
type: roundrobin
|
||||
nodes:
|
||||
backend:8000: 1
|
||||
plugins:
|
||||
jwt-auth:
|
||||
key: "user-key"
|
||||
secret: "my-secret-key"
|
||||
cors:
|
||||
allow_origins: "*"
|
||||
allow_methods: "GET,POST,PUT,DELETE,OPTIONS"
|
||||
allow_headers: "*"
|
||||
expose_headers: "*"
|
||||
limit-req:
|
||||
rate: 50
|
||||
burst: 25
|
||||
rejected_code: 429
|
||||
|
||||
- uri: /api/v1/admin/*
|
||||
name: admin-service
|
||||
upstream:
|
||||
type: roundrobin
|
||||
nodes:
|
||||
backend:8000: 1
|
||||
plugins:
|
||||
jwt-auth:
|
||||
key: "admin-key"
|
||||
secret: "admin-secret-key"
|
||||
ip-restriction:
|
||||
whitelist:
|
||||
- 10.0.0.0/8
|
||||
- 172.16.0.0/12
|
||||
- 192.168.0.0/16
|
||||
cors:
|
||||
allow_origins: "*"
|
||||
allow_methods: "GET,POST,PUT,DELETE,OPTIONS"
|
||||
allow_headers: "*"
|
||||
expose_headers: "*"
|
||||
limit-req:
|
||||
rate: 200
|
||||
burst: 100
|
||||
rejected_code: 429
|
||||
|
||||
- uri: /health
|
||||
name: health-check
|
||||
upstream:
|
||||
type: roundrobin
|
||||
nodes:
|
||||
backend:8000: 1
|
||||
plugins:
|
||||
limit-req:
|
||||
rate: 1000
|
||||
burst: 500
|
||||
|
||||
- uri: /*
|
||||
name: frontend
|
||||
upstream:
|
||||
type: roundrobin
|
||||
nodes:
|
||||
frontend:80: 1
|
||||
plugins:
|
||||
proxy-cache:
|
||||
cache_zone:
|
||||
name: disk_cache_one
|
||||
memory_size: 50m
|
||||
disk_size: 1G
|
||||
disk_path: "/tmp/disk_cache"
|
||||
cache_method:
|
||||
- GET
|
||||
- HEAD
|
||||
cache_http_status:
|
||||
- 200
|
||||
- 301
|
||||
- 404
|
||||
cache_ttl: 300
|
||||
hide_cache_headers: true
|
||||
Reference in New Issue
Block a user