cloudcover 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c46caee78e42162043834818f5be3311401cbef
4
- data.tar.gz: b39c7865e7175f6dbbe37d6acce347bf42e195b9
3
+ metadata.gz: dbb728764310a4e52eee3275ad788c2e9d7c7878
4
+ data.tar.gz: 156433fe14e1d78052f70a4432c7eeb74f1a1fef
5
5
  SHA512:
6
- metadata.gz: f9fb2ca5845c9fb0a639dfc25b4e81e0038236672844fe396c5e34fc03a9bcc9e246ea03edeb10682516c2a7104df3525a6f31c04f30db6ffb8568b8f36d3601
7
- data.tar.gz: da6f3e8f938865580c57e17ef097fab2b4bb4918a48239c7a1f74d9e3950ebf89f42ba7aeb573370912076921274816c466bdf6f6f0eca7cd9117fcce9e08db9
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 [:g, :group], :desc => 'Verify membership to the specified group during authentication', :default_value => false
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 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
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 is_valid_group_member
81
- @okta.groups.map{ |g| g[:id] }.include? group_id
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 group_id
89
- @opts[:group]
88
+ def app_id
89
+ @opts[:app]
90
90
  end
91
91
 
92
92
  def file_based?
@@ -42,6 +42,10 @@ module Cloudcover
42
42
  get_json('/api/v1/users/me/groups', headers: @headers)
43
43
  end
44
44
 
45
+ def myApps
46
+ get_json('/api/v1/users/me/appLinks', headers: @headers)
47
+ end
48
+
45
49
  def login_id
46
50
  me[:profile][:login]
47
51
  end
@@ -1,3 +1,3 @@
1
1
  module Cloudcover
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudcover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Krieger