mirror of
https://github.com/langgenius/dify.git
synced 2026-01-14 06:07:33 +08:00
- Add OAuth authorization URL generation API endpoint - Implement OAuth callback handler for credential storage - Support both system-level and tenant-level OAuth clients - Add trigger provider credential encryption utilities - Refactor trigger entities into separate modules - Update trigger provider service with OAuth client management - Add credential cache for trigger providers 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
706 B
Python
23 lines
706 B
Python
import logging
|
|
|
|
from flask import Request, Response
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class TriggerService:
|
|
__MAX_REQUEST_LOG_COUNT__ = 10
|
|
|
|
@classmethod
|
|
def process_webhook(cls, webhook_id: str, request: Request) -> Response:
|
|
"""Extract and process data from incoming webhook request."""
|
|
# TODO redis slidingwindow log, save the recent request log in redis, rollover the log when the window is full
|
|
|
|
# TODO find the trigger subscription
|
|
|
|
# TODO fetch the trigger controller
|
|
|
|
# TODO dispatch by the trigger controller
|
|
|
|
# TODO using the dispatch result(events) to invoke the trigger events
|
|
raise NotImplementedError("Not implemented") |