cloudcover 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloudcover/commands/simple_auth.rb +15 -1
- data/lib/cloudcover/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c46caee78e42162043834818f5be3311401cbef
|
4
|
+
data.tar.gz: b39c7865e7175f6dbbe37d6acce347bf42e195b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9fb2ca5845c9fb0a639dfc25b4e81e0038236672844fe396c5e34fc03a9bcc9e246ea03edeb10682516c2a7104df3525a6f31c04f30db6ffb8568b8f36d3601
|
7
|
+
data.tar.gz: da6f3e8f938865580c57e17ef097fab2b4bb4918a48239c7a1f74d9e3950ebf89f42ba7aeb573370912076921274816c466bdf6f6f0eca7cd9117fcce9e08db9
|
@@ -15,7 +15,7 @@ module Cloudcover
|
|
15
15
|
get_credentials
|
16
16
|
auth_response(false, "#{formatted_date(Time.now)} - #{context_message} - Access denied, failed login for #{username}") unless login
|
17
17
|
if group_id
|
18
|
-
auth_response(false,"#{formatted_date(Time.now)} - #{context_message} - Access denied, #{username} is not a member of group ID
|
18
|
+
auth_response(false,"#{formatted_date(Time.now)} - #{context_message} - Access denied, #{username} is not a member of group ID `#{group_id}`") unless is_valid_group_member
|
19
19
|
end
|
20
20
|
auth_response(true, "#{formatted_date(Time.now)} - #{context_message} - Access granted for #{username}")
|
21
21
|
end
|
@@ -31,6 +31,7 @@ module Cloudcover
|
|
31
31
|
if @opts[:radius]
|
32
32
|
abort 'Reject'
|
33
33
|
else
|
34
|
+
send_to_slack(msg) if Cloudcover::Config.slack[:report_auth_failures]
|
34
35
|
abort msg
|
35
36
|
end
|
36
37
|
end
|
@@ -100,6 +101,19 @@ module Cloudcover
|
|
100
101
|
context || DEFAULT_CONTEXT
|
101
102
|
end
|
102
103
|
|
104
|
+
def send_to_slack(msg)
|
105
|
+
Output.say_debug "Posting to slack..."
|
106
|
+
slackvars = [:username, :icon_url, :channel]
|
107
|
+
payload = { text: msg }
|
108
|
+
slackvars.each do |var|
|
109
|
+
payload.merge!({var=> Cloudcover::Config.slack[var]}) if Cloudcover::Config.slack[var]
|
110
|
+
end
|
111
|
+
|
112
|
+
HTTParty.post(Cloudcover::Config.slack[:webhook],
|
113
|
+
:body => "payload=#{payload.to_json}"
|
114
|
+
)
|
115
|
+
end
|
116
|
+
|
103
117
|
|
104
118
|
InvalidCredsFile = Class.new(StandardError)
|
105
119
|
end
|
data/lib/cloudcover/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudcover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Krieger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|