onelogin 1.5.0 → 1.7.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.
@@ -30,7 +30,7 @@ class Cursor
30
30
  @after_cursor = options.fetch(:after_cursor, nil)
31
31
  end
32
32
 
33
- def each(start = 0)
33
+ def each(start = 0, &proc)
34
34
  return to_enum(:each, start) unless block_given?
35
35
 
36
36
  Array(@collection[start..-1]).each do |item|
@@ -46,7 +46,7 @@ class Cursor
46
46
 
47
47
  fetch_next_page
48
48
 
49
- each(start, &Proc.new)
49
+ each(start, &proc)
50
50
  end
51
51
  end
52
52
 
@@ -54,8 +54,9 @@ class Cursor
54
54
 
55
55
  def fetch_next_page
56
56
  @params = @params.merge(after_cursor: @after_cursor) if @after_cursor
57
+ @client.prepare_token
57
58
 
58
- response = @client.get(
59
+ response = @client.class.get(
59
60
  @url,
60
61
  headers: @headers,
61
62
  query: @params
@@ -0,0 +1,20 @@
1
+ module OneLogin
2
+ module Api
3
+ module Models
4
+
5
+ class ConnectorBasic
6
+
7
+ attr_accessor :id, :name, :auth_method
8
+ attr_accessor :icon_url, :allows_new_parameters
9
+
10
+ def initialize(data)
11
+ @id = data['id']
12
+ @name = data['name']
13
+ @icon_url = data['icon_url']
14
+ @auth_method = data['auth_method']
15
+ @allows_new_parameters = data['allows_new_parameters']
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -9,7 +9,7 @@ module OneLogin
9
9
  :role_id, :role_name, :app_id, :app_name, :group_id, :group_name, :otp_device_id,
10
10
  :otp_device_name, :policy_id, :policy_name, :actor_system, :custom_message,
11
11
  :operation_name, :directory_sync_run_id, :directory_id, :resolution, :client_id,
12
- :resource_type_id, :error_description
12
+ :resource_type_id, :error_description, :risk_score, :risk_reasons, :risk_cookie_id, :browser_fingerprint
13
13
 
14
14
  def initialize(data)
15
15
  @id = data['id']
@@ -4,17 +4,57 @@ module OneLogin
4
4
 
5
5
  class OneLoginApp
6
6
 
7
- attr_accessor :id, :connector_id, :name, :extension
8
- attr_accessor :icon, :visible, :provisioning
7
+ attr_accessor :name, :visible, :policy_id, :is_available,
8
+ :parameters, :allow_assumed_signin,
9
+ :configuration, :notes, :description
10
+
11
+
12
+ attr_reader :created_at, :updated_at, :icon, :provisioning,
13
+ :connector_id, :sso, :auth_method, :id, :tab_id
9
14
 
10
15
  def initialize(data)
11
- @id = data['id']
12
- @connector_id = data['connector_id']
13
16
  @name = data['name']
14
- @extension = data['extension']
15
- @icon = data['icon']
16
17
  @visible = data['visible']
18
+ @policy_id = data['policy_id']? data['policy_id'].to_i : nil
19
+ @parameters = data['parameters']
20
+ @allow_assumed_signin = data['allow_assumed_signin']
21
+ @configuration = data['configuration']
22
+ @notes = data['notes']
23
+ @description = data['description']
24
+
25
+ @created_at = data['created_at']
26
+ @updated_at = data['updated_at']
27
+ @icon = data['icon_url']
17
28
  @provisioning = data['provisioning']
29
+ @connector_id = data['connector_id']? data['connector_id'].to_i : nil
30
+ @sso = data['sso']
31
+ @auth_method = data['auth_method']
32
+ @tab_id = data['tab_id']? data['tab_id'].to_i : nil
33
+ @id = data['id']? data['id'].to_i : nil
34
+ end
35
+
36
+ def get_auth_method_name
37
+ auth_method_name = nil
38
+ case @auth_method
39
+ when 0
40
+ auth_method_name = "PASSWORD"
41
+ when 1
42
+ auth_method_name = "OPENID"
43
+ when 2
44
+ auth_method_name = "SAML"
45
+ when 3
46
+ auth_method_name = "API"
47
+ when 4
48
+ auth_method_name = "GOOGLE"
49
+ when 6
50
+ auth_method_name = "BASIC_AUTH"
51
+ when 7
52
+ auth_method_name = "WSFED"
53
+ when 8
54
+ auth_method_name = "OIDC"
55
+ end
56
+
57
+ auth_method_name
18
58
  end
19
59
  end
20
60
  end
@@ -0,0 +1,51 @@
1
+ module OneLogin
2
+ module Api
3
+ module Models
4
+
5
+ class OneLoginAppBasic
6
+
7
+ attr_accessor :name, :visible,
8
+ :description
9
+
10
+ attr_reader :created_at, :updated_at,
11
+ :connector_id, :auth_method, :id
12
+
13
+ def initialize(data)
14
+ @id = data['id']? data['id'].to_i : nil
15
+ @name = data['name']
16
+ @description = data['description']
17
+ @auth_method = data['auth_method']
18
+ @connector_id = data['connector_id']? data['connector_id'].to_i : nil
19
+ @visible = data['visible']
20
+ @created_at = data['created_at']
21
+ @updated_at = data['updated_at']
22
+
23
+ end
24
+
25
+ def get_auth_method_name
26
+ auth_method_name = nil
27
+ case @auth_method
28
+ when 0
29
+ auth_method_name = "PASSWORD"
30
+ when 1
31
+ auth_method_name = "OPENID"
32
+ when 2
33
+ auth_method_name = "SAML"
34
+ when 3
35
+ auth_method_name = "API"
36
+ when 4
37
+ auth_method_name = "GOOGLE"
38
+ when 6
39
+ auth_method_name = "BASIC_AUTH"
40
+ when 7
41
+ auth_method_name = "WSFED"
42
+ when 8
43
+ auth_method_name = "OIDC"
44
+ end
45
+
46
+ auth_method_name
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,22 @@
1
+ module OneLogin
2
+ module Api
3
+ module Models
4
+
5
+ class OneLoginApp
6
+
7
+ attr_accessor :id, :connector_id, :name, :extension
8
+ attr_accessor :icon, :visible, :provisioning
9
+
10
+ def initialize(data)
11
+ @id = data['id']
12
+ @connector_id = data['connector_id']
13
+ @name = data['name']
14
+ @extension = data['extension']
15
+ @icon = data['icon']
16
+ @visible = data['visible']
17
+ @provisioning = data['provisioning']
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -51,7 +51,7 @@ module OneLogin
51
51
  @role_ids
52
52
  end
53
53
 
54
- def get_role_ids
54
+ def get_group_id
55
55
  @group_id
56
56
  end
57
57
 
@@ -1,5 +1,6 @@
1
1
  require 'onelogin/api/models/app'
2
2
  require 'onelogin/api/models/auth_factor'
3
+ require 'onelogin/api/models/connector_basic'
3
4
  require 'onelogin/api/models/device'
4
5
  require 'onelogin/api/models/event'
5
6
  require 'onelogin/api/models/event_type'
@@ -7,7 +8,9 @@ require 'onelogin/api/models/factor_enrollment_response'
7
8
  require 'onelogin/api/models/group'
8
9
  require 'onelogin/api/models/mfa'
9
10
  require 'onelogin/api/models/mfa_token'
11
+ require 'onelogin/api/models/onelogin_app_v1'
10
12
  require 'onelogin/api/models/onelogin_app'
13
+ require 'onelogin/api/models/onelogin_app_basic'
11
14
  require 'onelogin/api/models/onelogin_token'
12
15
  require 'onelogin/api/models/otp_device'
13
16
  require 'onelogin/api/models/privilege'
@@ -34,8 +34,22 @@ module OneLogin
34
34
  LOCK_USER_URL = "https://api.%s.onelogin.com/api/1/users/%s/lock_user"
35
35
  GENERATE_MFA_TOKEN_URL = "https://api.%s.onelogin.com/api/1/users/%s/mfa_token"
36
36
 
37
+ # Connectors URL
38
+ GET_CONNECTORS_URL = "https://api.%s.onelogin.com/api/2/connectors"
39
+ #GET_CONNECTOR_URL = "https://api.%s.onelogin.com/api/2/connectors/%s"
40
+
37
41
  # Apps URL
38
- GET_APPS_URL = "https://api.%s.onelogin.com/api/1/apps"
42
+
43
+ # V1
44
+ GET_APPS_URL_V1 = "https://api.%s.onelogin.com/api/1/apps"
45
+
46
+ # V2
47
+ GET_APPS_URL = "https://api.%s.onelogin.com/api/2/apps"
48
+ CREATE_APP_URL = "https://api.%s.onelogin.com/api/2/apps"
49
+ GET_APP_URL = "https://api.%s.onelogin.com/api/2/apps/%s"
50
+ UPDATE_APP_URL = "https://api.%s.onelogin.com/api/2/apps/%s"
51
+ DELETE_APP_URL = "https://api.%s.onelogin.com/api/2/apps/%s"
52
+ DELETE_APP_PARAMETER_URL = "https://api.%s.onelogin.com/api/2/apps/%s/parameters/%s"
39
53
 
40
54
  # Role URLs
41
55
  GET_ROLES_URL = "https://api.%s.onelogin.com/api/1/roles"
@@ -1,3 +1,3 @@
1
1
  module OneLogin
2
- VERSION = "1.5.0"
2
+ VERSION = "1.7.0"
3
3
  end
data/onelogin.gemspec CHANGED
@@ -39,7 +39,8 @@ Gem::Specification.new do |spec|
39
39
  spec.add_runtime_dependency('httparty', '>=0.13.7')
40
40
  spec.add_runtime_dependency('nokogiri', '>=1.6.3.1')
41
41
 
42
- spec.add_development_dependency "bundler", "~> 1.15"
42
+ spec.add_development_dependency "bundler"
43
43
  spec.add_development_dependency "rake", "~> 10.0"
44
44
  spec.add_development_dependency "rspec", "~> 3.0"
45
- end
45
+ spec.add_development_dependency "webmock", "~> 3.0"
46
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onelogin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OneLogin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-19 00:00:00.000000000 Z
11
+ date: 2026-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.15'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.15'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '3.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: webmock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
83
97
  description: OneLogin's Ruby SDK. Use this API client to interact with OneLogin's
84
98
  platform
85
99
  email:
@@ -90,6 +104,8 @@ extra_rdoc_files:
90
104
  - LICENSE
91
105
  - README.md
92
106
  files:
107
+ - ".github/workflows/git-secrets-public.yml"
108
+ - ".github/workflows/test.yml"
93
109
  - ".gitignore"
94
110
  - ".travis.yml"
95
111
  - CODE_OF_CONDUCT.md
@@ -103,8 +119,10 @@ files:
103
119
  - examples/Gemfile.lock
104
120
  - examples/README.md
105
121
  - examples/all-users-to-csv.rb
122
+ - examples/another-get-all-login-events-of-last-day-to-csv.rb
106
123
  - examples/create-user.rb
107
124
  - examples/events-to-csv.rb
125
+ - examples/get-all-login-events-of-last-day-to-csv.rb
108
126
  - examples/last-app-user-login-to-csv.rb
109
127
  - examples/list-users.rb
110
128
  - examples/rails-custom-login-page/.gitignore
@@ -220,6 +238,7 @@ files:
220
238
  - lib/onelogin/api/models.rb
221
239
  - lib/onelogin/api/models/app.rb
222
240
  - lib/onelogin/api/models/auth_factor.rb
241
+ - lib/onelogin/api/models/connector_basic.rb
223
242
  - lib/onelogin/api/models/device.rb
224
243
  - lib/onelogin/api/models/embed_app.rb
225
244
  - lib/onelogin/api/models/event.rb
@@ -229,6 +248,8 @@ files:
229
248
  - lib/onelogin/api/models/mfa.rb
230
249
  - lib/onelogin/api/models/mfa_token.rb
231
250
  - lib/onelogin/api/models/onelogin_app.rb
251
+ - lib/onelogin/api/models/onelogin_app_basic.rb
252
+ - lib/onelogin/api/models/onelogin_app_v1.rb
232
253
  - lib/onelogin/api/models/onelogin_token.rb
233
254
  - lib/onelogin/api/models/otp_device.rb
234
255
  - lib/onelogin/api/models/privilege.rb
@@ -252,7 +273,7 @@ licenses:
252
273
  - MIT
253
274
  metadata:
254
275
  allowed_push_host: https://rubygems.org
255
- post_install_message:
276
+ post_install_message:
256
277
  rdoc_options: []
257
278
  require_paths:
258
279
  - lib
@@ -267,9 +288,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
288
  - !ruby/object:Gem::Version
268
289
  version: '0'
269
290
  requirements: []
270
- rubyforge_project: http://www.rubygems.org/gems/onelogin-ruby-sdk
271
- rubygems_version: 2.4.8
272
- signing_key:
291
+ rubygems_version: 3.2.33
292
+ signing_key:
273
293
  specification_version: 4
274
294
  summary: OneLogin's Ruby SDK.
275
295
  test_files: []