zaikio-webhooks 0.0.6 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +35 -7
- data/app/controllers/zaikio/webhooks/webhooks_controller.rb +1 -1
- data/lib/zaikio/webhooks.rb +1 -0
- data/lib/zaikio/webhooks/configuration.rb +1 -1
- data/lib/zaikio/webhooks/event.rb +1 -0
- data/lib/zaikio/webhooks/event_serializer.rb +1 -1
- data/lib/zaikio/webhooks/version.rb +1 -1
- metadata +49 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d872489dc81bf856f2fffc2739c3e985530b06800a973029e0854b3b84a5538f
|
4
|
+
data.tar.gz: 1a15ca887a82dd696e0fbbccf44f0f40ff49a7e3ff392eb0f12608e3db9ffa4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82d3b14af857df3facfcad7afe8fcbcb270280ca8b5b4822c59179686638321221b7403313fc4f7c64e852e3e487dd651a1bcd6f53dc1e0aa6fd123c18b2871c
|
7
|
+
data.tar.gz: f962d5b40432a34acd7680cd5582b546326003230e6e5e0af8a432b4e130863962909bed64579fa188b6d18d857aaae5b675ee52dd1a1e73816ed0d82e0c5400
|
data/README.md
CHANGED
@@ -34,13 +34,6 @@ Zaikio::Webhooks.configure do |config|
|
|
34
34
|
my_other_app.shared_secret = "test-secret"
|
35
35
|
end
|
36
36
|
end
|
37
|
-
|
38
|
-
# Perform job immediately, for all clients
|
39
|
-
Zaikio::Webhooks.on "directory.revoked_access_token", RevokeAccessTokenJob,
|
40
|
-
perform_now: true
|
41
|
-
# Only for a specific client
|
42
|
-
Zaikio::Webhooks.on "directory.machine_added", AddMachineJob,
|
43
|
-
client_name: :my_app
|
44
37
|
```
|
45
38
|
|
46
39
|
### 3. Mount Engine
|
@@ -83,3 +76,38 @@ end
|
|
83
76
|
Login to [Zaikio Hub](https://directory.zaikio.com/) and go to your Apps and go to Edit App and add your webhook URL e.g. `https://mydomain.de/zaikio/webhook/my_app_name`.
|
84
77
|
|
85
78
|
Now you should receive all events you subscribed to.
|
79
|
+
|
80
|
+
### 7. Usage
|
81
|
+
|
82
|
+
When everything is set up you can register events with custom jobs, using the
|
83
|
+
`Zaikio::Webhooks.on` function. This is idempotent and can be safely re-executed.
|
84
|
+
|
85
|
+
We can setup an initializer like so:
|
86
|
+
|
87
|
+
```rb
|
88
|
+
# config/initializers/zaikio_webhooks.rb
|
89
|
+
|
90
|
+
# We need to add this special wrapper here because we're referencing autoloaded constants
|
91
|
+
# (RevokeAccessTokenJob, AddMachineJob) at boot time. For more information, see:
|
92
|
+
# https://guides.rubyonrails.org/autoloading_and_reloading_constants.html#autoloading-when-the-application-boots
|
93
|
+
Rails.application.reloader.to_prepare do
|
94
|
+
# Perform job immediately, for all clients
|
95
|
+
Zaikio::Webhooks.on "directory.revoked_access_token", RevokeAccessTokenJob,
|
96
|
+
perform_now: true
|
97
|
+
# Only for a specific client
|
98
|
+
Zaikio::Webhooks.on "directory.machine_added", AddMachineJob,
|
99
|
+
client_name: :my_app
|
100
|
+
end
|
101
|
+
```
|
102
|
+
|
103
|
+
## Contributing
|
104
|
+
|
105
|
+
- Make your changes and submit a pull request for them
|
106
|
+
- Make sure to update `CHANGELOG.md`
|
107
|
+
|
108
|
+
To release a new version of the gem:
|
109
|
+
- Update the version in `lib/zaikio/webhooks/version.rb`
|
110
|
+
- Update `CHANGELOG.md` to include the new version and its release date
|
111
|
+
- Commit and push your changes
|
112
|
+
- Create a [new release on GitHub](https://github.com/zaikio/zaikio-webhooks/releases/new)
|
113
|
+
- CircleCI will build the Gem package and push it Rubygems for you
|
data/lib/zaikio/webhooks.rb
CHANGED
metadata
CHANGED
@@ -1,17 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zaikio-webhooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zaikio GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: actionpack
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '6.0'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 6.0.2.2
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '6.0'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 6.0.2.2
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: activejob
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '6.0'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 6.0.2.2
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '6.0'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 6.0.2.2
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: railties
|
15
55
|
requirement: !ruby/object:Gem::Requirement
|
16
56
|
requirements:
|
17
57
|
- - "~>"
|
@@ -51,10 +91,12 @@ files:
|
|
51
91
|
- lib/zaikio/webhooks/event.rb
|
52
92
|
- lib/zaikio/webhooks/event_serializer.rb
|
53
93
|
- lib/zaikio/webhooks/version.rb
|
54
|
-
homepage: https://
|
94
|
+
homepage: https://github.com/zaikio/zaikio-webhooks
|
55
95
|
licenses:
|
56
96
|
- MIT
|
57
|
-
metadata:
|
97
|
+
metadata:
|
98
|
+
changelog_uri: https://github.com/zaikio/zaikio-webhooks/blob/main/CHANGELOG.md
|
99
|
+
source_code_uri: https://github.com/zaikio/zaikio-webhooks
|
58
100
|
post_install_message:
|
59
101
|
rdoc_options: []
|
60
102
|
require_paths:
|
@@ -63,14 +105,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
63
105
|
requirements:
|
64
106
|
- - ">="
|
65
107
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
108
|
+
version: 2.6.5
|
67
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
110
|
requirements:
|
69
111
|
- - ">="
|
70
112
|
- !ruby/object:Gem::Version
|
71
113
|
version: '0'
|
72
114
|
requirements: []
|
73
|
-
rubygems_version: 3.1.
|
115
|
+
rubygems_version: 3.1.4
|
74
116
|
signing_key:
|
75
117
|
specification_version: 4
|
76
118
|
summary: Handle incoming Zaikio loom webhooks
|