-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(verification webhooks): add events to webhooks to allow differen…
…tiation between pact and verification webhooks
- Loading branch information
Showing
15 changed files
with
175 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require_relative 'migration_helper' | ||
|
||
Sequel.migration do | ||
change do | ||
create_table(:webhook_events, charset: 'utf8') do | ||
primary_key :id | ||
foreign_key :webhook_id, :webhooks, on_delete: :cascade | ||
String :name | ||
DateTime :created_at, null: false | ||
DateTime :updated_at, null: false | ||
index [:id, :name], unique: true, name: 'uq_webhook_id_name' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require_relative 'migration_helper' | ||
|
||
Sequel.migration do | ||
up do | ||
from(:webhooks).each do | webhook | | ||
from(:webhook_events).insert( | ||
webhook_id: webhook[:id], | ||
name: 'contract_changed', | ||
created_at: DateTime.now, | ||
updated_at: DateTime.now | ||
) | ||
end | ||
end | ||
|
||
down do | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'sequel' | ||
require 'pact_broker/repositories/helpers' | ||
|
||
module PactBroker | ||
module Webhooks | ||
class WebhookEvent < Sequel::Model | ||
|
||
dataset_module do | ||
include PactBroker::Repositories::Helpers | ||
end | ||
|
||
end | ||
|
||
WebhookEvent.plugin :timestamps, update_on_create: true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{ | ||
"events": [{ | ||
"name": "something_happened" | ||
}], | ||
"request": { | ||
"method": "POST", | ||
"url": "http://some.url", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.