Download the PHP package cedricziel/canva-extension-helper without Composer
On this page you can find all versions of the php package cedricziel/canva-extension-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cedricziel/canva-extension-helper
More information about cedricziel/canva-extension-helper
Files in cedricziel/canva-extension-helper
Package canva-extension-helper
Short Description Canva.com extension helpers
License MIT
Homepage https://github.com/cedricziel/canva-extension-helper-php
Informations about the package canva-extension-helper
Canva.com extensions with PHP
Some utilities for building canva extensions.
Usage
Installation
Via composer:
With Symfony
Symfony projects usually come with a fully configured serializer and a configured http server layer.
The following Symfony controller is enough for a "Publish" extension with the basic
layout:
You can then "bind" the $canvaSecret
constructor argument to your Canva.com secret in services.yaml
:
Serialization
Note: This project provides model classes. De-/Serialization must be done by means of your application.
Example using the Symfony Serializer component:
Checking incoming requests
Canva requires extensions to check incoming requests for a timestamp skew and a matching HMAC signature. This packages provides helpers to cope with that easily.
Checking the timestamp:
For examples on how to check the signatures, please check the middleware section.
Middlewares
Canva requires you to check requests coming from their end. You can do so by manually verifying the timestamp headers
with the Canva\HttpHelper
class, or opt for a middleware you have to mount on the paths that canva will be talking to.
Canva\MiddlewareTimestampMiddleware
- Checks the time skew
Canva\Middleware\PostHMACMiddleware
- Checks the signature on POST requests
Canva\Middleware\GetHMACMiddleware
- Checks the signature on GET requests
Disclaimer
This project is not affiliated with Canva.com
License
MIT
All versions of canva-extension-helper with dependencies
ext-json Version *
psr/http-factory Version ^1.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/log Version ^1.1