slackify 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/slack_token_verify.rb +1 -2
- data/lib/slackify/configuration.rb +1 -1
- data/lib/slackify/handlers/base.rb +1 -0
- data/lib/slackify/parameter.rb +1 -0
- data/lib/slackify/router.rb +11 -7
- data/lib/slackify.rb +1 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9cdd391524228878a211afd455c9397efeb625535a3e604e9f58b7d8d086a1a
|
4
|
+
data.tar.gz: 180fe23f192a5b93c0dc8619a5c5a65d5007d3653da5b79adcaa122529fed146
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43df97f56923ad9ef388054ac1768acb799ff5d4709742ac048c4cb88b09cd423a7285d5072a916f2432df6dadce2464deb776130cfca46fbf7903ad825b47eb
|
7
|
+
data.tar.gz: 7bc76fbea055984979165fa5a2d1d4ceddd0bcf75517513e4f7e9019300c71f8fdc849b44cbdf7b23d6a95114d83916817f18ea0738866d3b2bab613a57256ab
|
@@ -26,8 +26,7 @@ module SlackTokenVerify
|
|
26
26
|
end
|
27
27
|
|
28
28
|
signature = "v0:#{timestamp}:#{request_body}"
|
29
|
-
calculated_hmac = "v0
|
30
|
-
OpenSSL::HMAC.hexdigest("sha256", Slackify.configuration.slack_secret_token, signature)
|
29
|
+
calculated_hmac = "v0=#{OpenSSL::HMAC.hexdigest('sha256', Slackify.configuration.slack_secret_token, signature)}"
|
31
30
|
|
32
31
|
return if ActiveSupport::SecurityUtils.secure_compare(calculated_hmac, hmac_header)
|
33
32
|
|
@@ -36,7 +36,7 @@ module Slackify
|
|
36
36
|
# Set the token that we will use to connect to slack
|
37
37
|
def slack_bot_token=(token)
|
38
38
|
@slack_bot_token = token
|
39
|
-
@slack_client = Slack::Web::Client.new(token: token)
|
39
|
+
@slack_client = Slack::Web::Client.new(token: token)
|
40
40
|
end
|
41
41
|
|
42
42
|
# Set a handler for a specific message subtype
|
data/lib/slackify/parameter.rb
CHANGED
data/lib/slackify/router.rb
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
module Slackify
|
4
4
|
# In charge of routing a message to its proper handler
|
5
5
|
class Router
|
6
|
+
MATCHING_QUOTES = {
|
7
|
+
"'": "'",
|
8
|
+
'"': '"',
|
9
|
+
'“': "”",
|
10
|
+
}.freeze
|
11
|
+
|
6
12
|
class << self
|
7
13
|
# List all available commands
|
8
14
|
def all_commands
|
@@ -57,16 +63,14 @@ module Slackify
|
|
57
63
|
current_key = current_key[0..-2].strip
|
58
64
|
|
59
65
|
# grab value accounting for any quotes
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
/'/
|
64
|
-
when '"'
|
65
|
-
s.skip(/"/)
|
66
|
-
/"/
|
66
|
+
next_char = s.getch
|
67
|
+
terminating_string = if (end_quote = MATCHING_QUOTES[next_char.to_sym])
|
68
|
+
/#{end_quote}/
|
67
69
|
else
|
70
|
+
s.unscan
|
68
71
|
/ /
|
69
72
|
end
|
73
|
+
|
70
74
|
processed_args[current_key.to_sym] = if s.exist?(terminating_string)
|
71
75
|
# grab everything before the next instance of the terminating character
|
72
76
|
s.scan_until(terminating_string)[0..-2]
|
data/lib/slackify.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slackify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Leger
|
8
8
|
- Michel Chatmajian
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
date: 2019-12-11 00:00:00.000000000 Z
|
@@ -139,7 +139,7 @@ licenses:
|
|
139
139
|
metadata:
|
140
140
|
source_code_uri: https://github.com/jusleg/slackify
|
141
141
|
changelog_uri: https://github.com/jusleg/slackify/blob/master/CHANGELOG.md
|
142
|
-
post_install_message:
|
142
|
+
post_install_message:
|
143
143
|
rdoc_options: []
|
144
144
|
require_paths:
|
145
145
|
- lib
|
@@ -154,8 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
|
-
rubygems_version: 3.
|
158
|
-
signing_key:
|
157
|
+
rubygems_version: 3.3.3
|
158
|
+
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: Slackbot framework for Rails using the Events API
|
161
161
|
test_files: []
|