oauth_im 0.10.3 → 0.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22d12f50a39c1a642f23bcbaa44e9714ca0c6524cfa364e6872a14b41a7ce582
4
- data.tar.gz: 1aca1d5f3683936829fa3886c58570ba89095542c6ceb5447c77afdc86e3edd1
3
+ metadata.gz: decb65e3a5b2753a1a2ecc5dd73f7e149724278cf1a7ec8ac8083668ab99da2f
4
+ data.tar.gz: d5e22d069de29e8a9b4b5f3deaae75dcf89b4602b098380d65678cce6938b553
5
5
  SHA512:
6
- metadata.gz: 567b8a9267a062b6b06d18930d85b94e14eeb8cffc8f4bd25fdbfbbbf4b30de3475c3ace6d2c7defe24a57bd3da4262142e0ab68a622407b9a55b6df04203c09
7
- data.tar.gz: fa168d58bf0786d43f04d209e5b6b7bf7b4ac201702f8f0730984bd63e50fecbb748ee2a9e9b17c5b085a9eff85f11c654a0bf26664561216ede2d1e707dcd69
6
+ metadata.gz: 859e9ea75b6ba0505cee390e3edb0c7119aef4225447470a31d0e330017d15ca69c4b4f179a7cd6582f61b77b41396b6ef8d3028c7eefca648f0448cb6f8aa36
7
+ data.tar.gz: 69ef30f3cb1800dffdae068043db0b1328e860994d23a8759fefe64123bb7bac07a70e22e78bd7171774db2cf302633a9f33151c1c1001bc7ddf97c81c9effa0
@@ -4,11 +4,17 @@ require 'fusionauth/fusionauth_client'
4
4
 
5
5
  module OauthIm
6
6
  class AdminClient < IdpClient
7
- def search_for(term: '', email: '')
7
+ def search_for(term: '', email: '', limit: 25, offset: 0)
8
8
  if email.present?
9
9
  proxy_users_for client.retrieve_user_by_email(email)
10
10
  elsif term.present?
11
- proxy_users_for client.search_users_by_query({ search: { queryString: term } })
11
+ proxy_users_for client.search_users_by_query(
12
+ search: {
13
+ numberOfResults: limit,
14
+ queryString: term,
15
+ startRow: offset
16
+ }
17
+ )
12
18
  else
13
19
  []
14
20
  end
@@ -43,6 +43,10 @@ module OauthIm
43
43
  reset_attrs
44
44
  end
45
45
 
46
+ def set_password(password, change_required: true)
47
+ update_user(password: password, passwordChangeRequired: change_required)
48
+ end
49
+
46
50
  def deactivate
47
51
  client.deactivate_user user_id
48
52
  reset_attrs
@@ -63,12 +67,21 @@ module OauthIm
63
67
  reset_attrs
64
68
  end
65
69
 
70
+ def update_user(data)
71
+ client.patch_user user_id, params_for_user(data)
72
+ reset_attrs
73
+ end
74
+
66
75
  def params_for(data)
67
76
  { registration:
68
77
  { applicationId: application_id,
69
78
  data: data } }
70
79
  end
71
80
 
81
+ def params_for_user(data)
82
+ { applicationId: application_id, user: data }
83
+ end
84
+
72
85
  def reset_attrs
73
86
  @attrs = AdminClient.new.proxy_attrs_for(user_id: user_id)
74
87
  self
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OauthIm
4
- VERSION = '0.10.3'
4
+ VERSION = '0.12.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth_im
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Connally
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-09 00:00:00.000000000 Z
11
+ date: 2022-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fusionauth_client