mosl / opensign-bridge-bundle
Symfony bundle bridging OpenSign (e-signature)
Package info
github.com/imdela/OpenSignBridgeBundle
Type:symfony-bundle
pkg:composer/mosl/opensign-bridge-bundle
Requires
- php: >=8.2
- guzzlehttp/guzzle: ^7.8
- symfony/console: 8.0.*
- symfony/framework-bundle: 8.0.*
- symfony/http-kernel: 8.0.*
- symfony/var-exporter: 8.0.*
- symfony/yaml: 8.0.*
Requires (Dev)
- larament/dot-env-editor: ^2.0
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^10.5
- symplify/easy-coding-standard: ^12.1
README
OpenSignBridgeBundle
moslstands for Mosaic OpenSource Library.
This Symfony bundle provides the complete infrastructure and service layer needed to integrate OpenSign and MinIO into any Symfony project.
🚀 Quick Start (Development)
To test or develop the bundle independently:
-
Ensure Containers are Up:
task up
-
Bootstrap OpenSign: This command creates the API user, generates tokens, and initializes the MongoDB schema.
task opensign:setup
-
Restart Containers: Apply the new environment variables from
.env.distto the running PHP container.task restart
📦 Installation in a Host App
-
Require the bundle via Composer:
composer require mosl/opensign-bridge-bundle
-
Ensure the bundle is registered in
config/bundles.php:return [ // ... Mosl\OpenSignBridgeBundle\OpenSignBridgeBundle::class => ['all' => true], ];
-
Configure your environment variables (
.env):OPENSIGN_APP_ID=your_app_id OPENSIGN_MASTER_KEY=your_master_key OPENSIGN_API_URL=http://your-opensign-url/app OPENSIGN_USER_ID=your_system_user_id OPENSIGN_SESSION_TOKEN=your_session_token OPENSIGN_WEBHOOK_SECRET=your_opensign_webhook_security_key
OPENSIGN_WEBHOOK_SECRETis required — it must match the "Webhook Security Key" configured in your OpenSign instance's webhook settings. The bundle uses it to verify thex-webhook-signatureheader (HMAC-SHA256) on every incoming webhook call, and refuses to boot if it is missing or empty. Requests with a missing or invalid signature are rejected with401 Unauthorized. -
Add the bundle configuration (
config/packages/opensign_bridge.yaml):opensign_bridge: opensign: app_id: "%env(OPENSIGN_APP_ID)%" master_key: "%env(OPENSIGN_MASTER_KEY)%" api_url: "%env(OPENSIGN_API_URL)%" user_id: "%env(OPENSIGN_USER_ID)%" session_token: "%env(OPENSIGN_SESSION_TOKEN)%" webhook_secret: "%env(OPENSIGN_WEBHOOK_SECRET)%"
-
Register the Webhook routes (
config/routes.yaml):opensign_bridge_routes: resource: "@OpenSignBridgeBundle/config/routes.yaml"
📖 Documentation
For full details on usage, services, and handling webhooks, see the Full Integration Guide.
