Code Monkey home page Code Monkey logo

Comments (2)

vista-narvas avatar vista-narvas commented on June 25, 2024

steps i took to reproduce

  1. composer create-project laravel/laravel .
  2. composer require spatie/laravel-webhook-client
  3. php artisan vendor:publish --provider="Spatie\WebhookClient\WebhookClientServiceProvider" --tag="webhook-client-config"
  4. php artisan vendor:publish --provider="Spatie\WebhookClient\WebhookClientServiceProvider" --tag="webhook-client-migrations"
  5. php artisan migrate:fresh
  6. vi routes/web.php add Route::webhooks('webhook');
  7. vi app/Http/Middleware/VerifyCsrfToken.php add webhook to $except
  8. vi app/Http/Webhook/GiteaValidator.php custom validator that always give true
<?php
namespace App\Http\Webhook;

use Illuminate\Http\Request;
use Spatie\WebhookClient\SignatureValidator\SignatureValidator;
use Spatie\WebhookClient\WebhookConfig;

class GiteaValidator implements SignatureValidator
{
    public function isValid(Request $request, WebhookConfig $config): bool
    {
        return true;
    }
}
  1. vi app/Jobs/Webhook.php as minimal class that never gets reached
<?php

namespace App\Jobs;

use Spatie\WebhookClient\Jobs\ProcessWebhookJob;

class Webhook extends ProcessWebhookJob
{
    public function __construct()
    {
        logger("yay construct");
    }

    public function handle(): void
    {
        logger("yay handle");
    }
}
  1. vi config/webhook-client.php set 'signature_validator' => App\Http\Webhook\GiteaValidator::class and 'process_webhook_job' => App\Jobs\Webhook::class
  2. php artisan serve
  3. send a webhook and recive a error

from laravel-webhook-client.

vista-narvas avatar vista-narvas commented on June 25, 2024

i did some more tests
i tried the same install commands in a Ubuntu container and than everything works fine
so i think im missing a php package but i dont know which package

from laravel-webhook-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.