cloudcover 0.1.0 → 0.2.0
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 +4 -4
- data/bin/cloudcover +1 -1
- data/lib/cloudcover/commands/simple_auth.rb +6 -6
- data/lib/cloudcover/okta/client.rb +4 -0
- data/lib/cloudcover/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbb728764310a4e52eee3275ad788c2e9d7c7878
|
4
|
+
data.tar.gz: 156433fe14e1d78052f70a4432c7eeb74f1a1fef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e50396dcbbbce2a0ad2d276847ebf3b8b024f4b09a149bc173d9b41ea3b7527903cf716c3171585ef7f594918e3db97c9f355a351a3880f07c2965d8fd81ca4e
|
7
|
+
data.tar.gz: 8dd3cf589676ca586921628d4cab961d3ef2165d8d018c5c2d3d6791b1f607d5dfb17dbf4b9c3ef7a0851eb3e28f8a892926dd151ce0bc4d90bab52b702c1212
|
data/bin/cloudcover
CHANGED
@@ -22,7 +22,7 @@ arg_name '[credential file path]'
|
|
22
22
|
command 'simple-auth' do |c|
|
23
23
|
c.switch [:f], :desc => 'Get credentials from file path specified as first argument (Useful for OpenVPN authentication)'
|
24
24
|
c.switch [:radius], :desc => 'Return RADIUS style Accept/Reject Messages', :negatable => false
|
25
|
-
c.flag [:
|
25
|
+
c.flag [:a, :app], :desc => 'Verify membership to the specified application during authentication', :default_value => false
|
26
26
|
c.flag [:c, :context], :desc => 'Extra context for success/fail message', :default_value => false
|
27
27
|
|
28
28
|
c.action do |global,options,args|
|
@@ -14,8 +14,8 @@ module Cloudcover
|
|
14
14
|
def verify_user
|
15
15
|
get_credentials
|
16
16
|
auth_response(false, "#{formatted_date(Time.now)} - #{context_message} - Access denied, failed login for #{username}") unless login
|
17
|
-
if
|
18
|
-
auth_response(false,"#{formatted_date(Time.now)} - #{context_message} - Access denied, #{username}
|
17
|
+
if app_id
|
18
|
+
auth_response(false,"#{formatted_date(Time.now)} - #{context_message} - Access denied, #{username} does not have access to application ID `#{app_id}`") unless has_application_access?
|
19
19
|
end
|
20
20
|
auth_response(true, "#{formatted_date(Time.now)} - #{context_message} - Access granted for #{username}")
|
21
21
|
end
|
@@ -77,16 +77,16 @@ module Cloudcover
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
def
|
81
|
-
@okta.
|
80
|
+
def has_application_access?
|
81
|
+
@okta.myApps.map{ |g| g[:appInstanceId] }.include? app_id
|
82
82
|
end
|
83
83
|
|
84
84
|
def date_format
|
85
85
|
Cloudcover::Config.date_format ? Cloudcover::Config.date_format : "%a %b %e %H:%M:%S %Y"
|
86
86
|
end
|
87
87
|
|
88
|
-
def
|
89
|
-
@opts[:
|
88
|
+
def app_id
|
89
|
+
@opts[:app]
|
90
90
|
end
|
91
91
|
|
92
92
|
def file_based?
|
data/lib/cloudcover/version.rb
CHANGED