oauth_im 0.11.0 → 0.12.1

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: 3e55554bb19c99609987221e3459cdfa64e081a00bca42e5cdd716dbba825c3e
4
- data.tar.gz: 5e00ecc4178482ab08985758e8e8da6610c3a73f8a8508b85ecda6caaa3dfe7b
3
+ metadata.gz: d76c8274bed6bd0f1186d0f91c3f19d1f4c9c3f33fb76f42aabef39aa8e69abc
4
+ data.tar.gz: 7aa343de7cd28ba873083f234c8af2129673bf1f362fcbedc48749ed637f8e26
5
5
  SHA512:
6
- metadata.gz: 63e320019d26c54d1d12b805e2d30f2a158f3cabf2d67a762d82319e793522e7c3f84c71072062060b917e78d8a7cbb77763d93e45438310fac7e37a6586195e
7
- data.tar.gz: 2183f526608c15a64e801653a5fc8eeee58b75d8123de3dbfc74d5c1b4868890fc976315acb813b3c7febcdcc7b0c5179a58e75e091fde58409eec372698a260
6
+ metadata.gz: 16ef3dc4382aef3277073f88ad5acacbff0cb036c7dcf971d207b03bc29ef2e3e455a73c90e954426c1b81e5117c6cbeb30af28f7ca12db84045e3271282ae23
7
+ data.tar.gz: 5e270df61e8e55069d2c788347e26492c359ed0fcbc3dcc38707e5bd60098e6e2ce8ef95e184e5d5167828a601f46bbaa03917b461068c7130c6f261bfa97f43
@@ -12,6 +12,7 @@ module OauthIm
12
12
 
13
13
  delegate :email, :email_verified?,
14
14
  :user_is_sponsor?,
15
+ :current_user_id,
15
16
  :admin?,
16
17
  to: :user_client,
17
18
  allow_nil: true
@@ -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
@@ -25,8 +25,14 @@ module OauthIm
25
25
  jwt_token[:roles].include? 'admin'
26
26
  end
27
27
 
28
+ alias current_user_id application_id
29
+
28
30
  private
29
31
 
32
+ def application_id
33
+ @application_id ||= jwt_token[:applicationId]
34
+ end
35
+
30
36
  def attrs
31
37
  @attrs ||= success_response[:user] || {}
32
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OauthIm
4
- VERSION = '0.11.0'
4
+ VERSION = '0.12.1'
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.11.0
4
+ version: 0.12.1
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-13 00:00:00.000000000 Z
11
+ date: 2022-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fusionauth_client