api key and security

This commit is contained in:
salvacybersec
2025-11-13 03:40:05 +03:00
parent 763a5a0a01
commit 372ed6401b
7 changed files with 1210 additions and 21 deletions

View File

@@ -6,6 +6,8 @@ YouTube video transkriptlerini otomatik olarak çıkarıp, tam metin içeren RSS
-**RSS-Bridge benzeri URL template** - Kanal adı/linki ile direkt feed
-**Web Server Modu** - Flask ile RESTful API
-**API Key Authentication** - Tüm endpoint'ler API key gerektirir
-**Güvenlik Önlemleri** - SQL injection, XSS, rate limiting koruması
- ✅ RSS-Bridge entegrasyonu (100+ video desteği)
- ✅ Async rate limiting (AIOLimiter)
- ✅ SpaCy ile Sentence Boundary Detection
@@ -29,27 +31,41 @@ docker-compose up -d
docker-compose logs -f
```
### API Key Yapılandırması
**ÖNEMLİ:** Tüm endpoint'ler API key gerektirir!
API key'leri `config/security.yaml` dosyasından yönetin:
```yaml
security:
require_api_key: true
api_keys:
demo_key_12345:
name: "Demo API Key"
rate_limit: 100
enabled: true
```
### URL Template Kullanımı
RSS-Bridge benzeri URL template sistemi:
```
# Channel ID ile
http://localhost:5000/?channel_id=UC9h8BDcXwkhZtnqoQJ7PggA&format=Atom
```bash
# Channel ID ile (API key header'da)
curl -H "X-API-Key: demo_key_12345" \
"http://localhost:5000/?channel_id=UC9h8BDcXwkhZtnqoQJ7PggA&format=Atom"
# Channel Handle ile
http://localhost:5000/?channel=@tavakfi&format=Atom
# Channel Handle ile (API key query parametresi)
curl "http://localhost:5000/?channel=@tavakfi&format=Atom&api_key=demo_key_12345"
# Channel URL ile
http://localhost:5000/?channel_url=https://www.youtube.com/@tavakfi&format=Atom
# RSS formatı
http://localhost:5000/?channel=@tavakfi&format=Rss
# Maksimum video sayısı
http://localhost:5000/?channel=@tavakfi&format=Atom&max_items=100
curl -H "X-API-Key: demo_key_12345" \
"http://localhost:5000/?channel_url=https://www.youtube.com/@tavakfi&format=Atom&max_items=100"
```
**Detaylı API dokümantasyonu için:** [API.md](API.md)
### Batch Mode (Manuel Çalıştırma)
```bash
@@ -78,6 +94,8 @@ python main.py
## Yapılandırma
### Ana Yapılandırma
`config/config.yaml` dosyasını düzenleyin:
```yaml
@@ -92,6 +110,23 @@ rss_bridge:
max_items: 100
```
### Güvenlik Yapılandırması
`config/security.yaml` dosyasından API key'leri ve güvenlik ayarlarını yönetin:
```yaml
security:
require_api_key: true
api_keys:
your_api_key_here:
name: "Your API Key"
rate_limit: 100
enabled: true
default_rate_limit: 60
```
**Detaylı güvenlik dokümantasyonu için:** [SECURITY.md](SECURITY.md)
## Proje Yapısı
```
@@ -113,6 +148,18 @@ yttranscriptrss/
└── main.py
```
## Dokümantasyon
- **[API.md](API.md)** - Detaylı API dokümantasyonu, endpoint'ler, örnekler
- **[SECURITY.md](SECURITY.md)** - Güvenlik önlemleri, best practices
- **[development_plan.md](development_plan.md)** - Geliştirme planı ve roadmap
## Endpoints
- `GET /` - RSS/Atom feed oluştur (API key gerekli)
- `GET /health` - Health check (API key gerekmez)
- `GET /info` - API bilgileri (API key gerekli)
## Geliştirme Planı
Detaylı geliştirme planı için `development_plan.md` dosyasına bakın.