foreman_webhooks 3.2.2 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8624e8cbf87d117b0c2af79063eaee6f074c274a7dd80bb77e95f2968b2ef490
|
4
|
+
data.tar.gz: e8815d672c53bccd6b2495d22e72d280cb9aa5ba5c1282de0bb9d38779f5f357
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a881ed5043657b90161a2eeba668975e2824ad246b566f4baa9b8ba094ab8504e4bbdd41ad27efa7c55cad4c599577aa5142dca8c0d969556fd117239605514f
|
7
|
+
data.tar.gz: 140c159bf311194d8baace102462969c02e941f06654a0bc8de7362b4d328513844b5a631bfd7eafbad365c395b4f645430593cee70d6a3b2f9246ada5718374
|
@@ -21,14 +21,17 @@ module ForemanWebhooks
|
|
21
21
|
end
|
22
22
|
|
23
23
|
apipie :method, 'Creates final payload' do
|
24
|
-
|
24
|
+
optional :hash, Hash, 'Key:value object with with data that should be present in payload', default: {}
|
25
25
|
keyword :with_defaults, [true, false], 'If set to true, adds default entries to the payload', default: true
|
26
|
+
kwlist :kwargs, 'Additional key:value pairs that should be added to the payload'
|
26
27
|
returns String, 'JSON string with the final payload'
|
27
28
|
example 'payload({ id: @object.id, name: @object.name }) #=> ' \
|
28
29
|
'"{ "id": 1, "name": "host.example.com", "context": { ... }, ' \
|
29
30
|
'"event_name": "host_created.event.foreman" }"'
|
30
31
|
end
|
31
|
-
def payload(hash, with_defaults: true)
|
32
|
+
def payload(hash = {}, with_defaults: true, **kwargs)
|
33
|
+
raise ArgumentError, 'The first argument must be either a hash or a comma-separated list with key:value pairs' unless hash.is_a?(Hash)
|
34
|
+
hash.merge!(kwargs)
|
32
35
|
hash.merge!(@defaults) if with_defaults
|
33
36
|
hash.to_json
|
34
37
|
end
|
data/app/models/webhook.rb
CHANGED
@@ -130,6 +130,7 @@ class Webhook < ApplicationRecord
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def rendered_payload(event_name, payload)
|
133
|
+
raise ::Foreman::Exception.new(N_("Webhook template not found while firing webhook '%s'. Possible organization/location mismatch in the webhook template?"), name) if webhook_template.nil?
|
133
134
|
webhook_template.render(variables: variables(event_name, payload))
|
134
135
|
end
|
135
136
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_webhooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timo Goebel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: theforeman-rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.1.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.1.0
|
41
55
|
description: Plugin for Foreman that allows to configure Webhooks.
|
42
56
|
email:
|
43
57
|
- mail@timogoebel.name
|
@@ -253,14 +267,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
253
267
|
requirements:
|
254
268
|
- - ">="
|
255
269
|
- !ruby/object:Gem::Version
|
256
|
-
version: 2.
|
270
|
+
version: 2.7.0
|
257
271
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
258
272
|
requirements:
|
259
273
|
- - ">="
|
260
274
|
- !ruby/object:Gem::Version
|
261
275
|
version: '0'
|
262
276
|
requirements: []
|
263
|
-
rubygems_version: 3.
|
277
|
+
rubygems_version: 3.2.33
|
264
278
|
signing_key:
|
265
279
|
specification_version: 4
|
266
280
|
summary: Configure webhooks for Foreman.
|