wip
This commit is contained in:
@@ -90,7 +90,7 @@ sequenceDiagram
|
||||
participant HS as HttpServer
|
||||
participant WH as Webhook Handler
|
||||
participant WV as Webhook Verifier
|
||||
participant RC as RhaiDispatcher
|
||||
participant RC as RhaiSupervisor
|
||||
participant Redis as Redis
|
||||
|
||||
WS->>+HS: POST /webhooks/{provider}/{circle_pk}
|
||||
@@ -102,7 +102,7 @@ sequenceDiagram
|
||||
|
||||
alt Signature Valid
|
||||
WH->>WH: Parse webhook payload (heromodels types)
|
||||
WH->>+RC: Create RhaiDispatcher with caller_id
|
||||
WH->>+RC: Create RhaiSupervisor with caller_id
|
||||
RC->>+Redis: Execute webhook script
|
||||
Redis-->>-RC: Script result
|
||||
RC-->>-WH: Execution result
|
||||
@@ -128,6 +128,6 @@ sequenceDiagram
|
||||
| **Connection Type** | Persistent, bidirectional | HTTP request/response |
|
||||
| **Authentication** | secp256k1 signature-based | HMAC signature verification |
|
||||
| **State Management** | Stateful sessions via CircleWs actor | Stateless HTTP requests |
|
||||
| **Script Execution** | Direct via authenticated session | Via RhaiDispatcher with provider caller_id |
|
||||
| **Script Execution** | Direct via authenticated session | Via RhaiSupervisor with provider caller_id |
|
||||
| **Use Case** | Interactive client applications | External service notifications |
|
||||
| **Data Types** | JSON-RPC messages | Provider-specific webhook payloads (heromodels) |
|
@@ -19,8 +19,8 @@ graph TB
|
||||
E[Webhook Handler]
|
||||
F[Stripe Verifier]
|
||||
G[iDenfy Verifier]
|
||||
H[Script Dispatcher]
|
||||
I[RhaiDispatcherBuilder]
|
||||
H[Script Supervisor]
|
||||
I[RhaiSupervisorBuilder]
|
||||
end
|
||||
|
||||
subgraph "Configuration"
|
||||
@@ -92,8 +92,8 @@ sequenceDiagram
|
||||
participant WS as Webhook Service
|
||||
participant CS as Circle Server
|
||||
participant WV as Webhook Verifier
|
||||
participant SD as Script Dispatcher
|
||||
participant RC as RhaiDispatcher
|
||||
participant SD as Script Supervisor
|
||||
participant RC as RhaiSupervisor
|
||||
participant RW as Rhai Worker
|
||||
|
||||
WS->>CS: POST /webhooks/stripe/{circle_pk}
|
||||
@@ -113,7 +113,7 @@ sequenceDiagram
|
||||
|
||||
alt Verification Success
|
||||
CS->>SD: Dispatch appropriate script
|
||||
SD->>RC: Create RhaiDispatcherBuilder
|
||||
SD->>RC: Create RhaiSupervisorBuilder
|
||||
RC->>RC: Set caller_id="stripe" or "idenfy"
|
||||
RC->>RC: Set recipient_id=circle_pk
|
||||
RC->>RC: Set script="stripe_webhook_received" or "idenfy_webhook_received"
|
||||
@@ -248,8 +248,8 @@ heromodels/src/models/
|
||||
### Key Architectural Changes
|
||||
- **Type Organization**: Webhook payload types moved to `heromodels` library for reusability
|
||||
- **Modular Handlers**: Separate handler files for each webhook provider
|
||||
- **Simplified Architecture**: Removed unnecessary dispatcher complexity
|
||||
- **Direct Script Execution**: Handlers directly use `RhaiDispatcher` for script execution
|
||||
- **Simplified Architecture**: Removed unnecessary supervisor complexity
|
||||
- **Direct Script Execution**: Handlers directly use `RhaiSupervisor` for script execution
|
||||
|
||||
### Modified Files
|
||||
- `src/lib.rs` - Add webhook routes and module imports
|
||||
|
Reference in New Issue
Block a user