4 Commits

Author SHA1 Message Date
Head of Product & Engineering
83de6cb089 fix: correct MONGO_URI to use Docker service hostname
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
localhost:27017 resolves to the container itself inside Docker.
The mongo service is reachable via its compose service name 'mongo'.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-05 18:48:29 +02:00
Head of Product & Engineering
877895f43e fix: correct domain from ghl.cast.ph to hl.cast.ph throughout
Update all active config and documentation files to use the correct
production domain hl.cast.ph (not ghl.cast.ph).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-05 14:09:43 +02:00
Head of Product & Engineering
a2826a3da7 fix: switch webhook signature verification from ECDSA to RSA-PKCS1v15+SHA-256
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
GHL uses RSA + SHA-256 for x-wh-signature, not ECDSA P-256 as documented
in the original task files. Also adds forward-compatible Ed25519 support
for X-GHL-Signature (GHL migration scheduled July 2026): handler checks
X-GHL-Signature first, falls back to x-wh-signature.

- webhook.go: replace ecdsa.VerifyASN1 with rsa.VerifyPKCS1v15; add
  verifyEd25519 + verifyIncomingSignature dispatch; update struct fields
- webhook_test.go: regenerate test keys as RSA-2048, sign with PKCS1v15
- CLAUDE.md: correct crypto stack and key implementation notes
- .env.example: clarify GHL_WEBHOOK_PUBLIC_KEY is a static RSA key from docs

Co-Authored-By: SideKx <sidekx.ai@sds.dev>
2026-04-05 01:15:56 +02:00
Head of Product & Engineering
a40a4aa626 feat: initial implementation of Cast GHL Provider
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Complete MVP implementation of the Cast GHL Conversation Provider bridge:
- Go module setup with chi router and mongo-driver dependencies
- Config loading with env var validation and defaults
- MongoDB token store with upsert, get, update, delete operations
- Cast.ph SMS client with 429 retry logic and typed errors
- Phone number normalization (E.164 ↔ Philippine local format)
- GHL OAuth 2.0 install/callback/refresh flow
- GHL webhook handler with ECDSA signature verification (async dispatch)
- GHL API client for message status updates and inbound message stubs
- Multi-stage Dockerfile, docker-compose with MongoDB, Woodpecker CI pipeline
- Unit tests for phone normalization, Cast client, GHL webhook, and OAuth handlers

Co-Authored-By: SideKx <sidekx.ai@sds.dev>
2026-04-04 17:27:05 +02:00