audiences 1.5.3 → 1.5.4

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
  SHA256:
3
- metadata.gz: b2128c153d299dd4a2fa4f94d5830dcf883cbf0b1b9300ca0905d0b5816fcc53
4
- data.tar.gz: feb6f90c5e3cf41e4331fce62cca0b8fb42cb94f1570283f4b760beec23a1a36
3
+ metadata.gz: fd59db4417464971778494de7c990f84e60c53437f2fe42539f346982ccbfb78
4
+ data.tar.gz: '048a21bed0712f1319b0a307a7d673e90ebdb1e8bf2dbff83e07866ffe642e2b'
5
5
  SHA512:
6
- metadata.gz: 7831f938d1841653b4829f8726bcdd491888a048e633fc98fe45a7978e9fb5cb789f5d420ace6b18d66d75782c6a87da4437b046c5a54a0c772b153f2f718eaf
7
- data.tar.gz: 258c57d51a40fa73560ac5c2a01dedbc567923956fa5f237de8bd714c97f8cdeac95b9aab13fdf7bfb4c60a5b21d23e2fa681072318565c127ab93a9ee36a409
6
+ metadata.gz: 46734c2a07e2c7613a686371e3b65a22db975bfd857ef1ea6a10785ea65399016394802046018b94eb84a9c2fbd95c66469f28ce4620a35c24ec6f2da4af71bd
7
+ data.tar.gz: d246e5e8636ffaded7bb3ae150d3df5cc185c8223f526c6cecb578f51810597098241c47f25a1b5e625bc45f8395a88b7aa6da852e519efc8d92d35b12cddced
@@ -32,7 +32,7 @@ module Audiences
32
32
  end
33
33
 
34
34
  def signed_key
35
- to_sgid(for: SIGNED_GID_RESOURCE)
35
+ to_sgid(for: SIGNED_GID_RESOURCE).to_s
36
36
  end
37
37
  end
38
38
  end
@@ -10,11 +10,13 @@ module Audiences
10
10
  inverse_of: false
11
11
  end
12
12
 
13
- def self.fetch(external_ids)
13
+ def self.fetch(external_ids, count: 100)
14
14
  return [] unless external_ids.any?
15
15
 
16
- filter = Array(external_ids).map { "externalId eq #{_1}" }.join(" OR ")
17
- Audiences::Scim.resource(:Users).all(filter: filter)
16
+ Array(external_ids).in_groups_of(count, false).flat_map do |ids|
17
+ filter = Array(ids).map { "externalId eq #{_1}" }.join(" OR ")
18
+ Audiences::Scim.resource(:Users).all(count: count, filter: filter).to_a
19
+ end
18
20
  end
19
21
 
20
22
  def self.wrap(resources)
data/config/routes.rb CHANGED
@@ -1,19 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Audiences::Engine.routes.draw do
4
+ root "contexts#show"
5
+
4
6
  get "/scim(/*scim_path)" => "scim_proxy#get", as: :scim_proxy
5
7
  get "/:key" => "contexts#show", as: :signed_context
6
8
  get "/:key/users(/:criterion_id)" => "contexts#users", as: :users
7
9
  put "/:key" => "contexts#update"
8
10
  end
9
-
10
- Rails.application.routes.draw do
11
- direct :audience_context do |owner, relation = nil|
12
- context = Audiences::Context.for(owner, relation: relation)
13
- audiences.route_for(:signed_context, key: context.signed_key, **url_options)
14
- end
15
-
16
- direct :audience_scim_proxy do |options|
17
- audiences.route_for(:scim_proxy, **url_options, **options)
18
- end
19
- end
data/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Unreleased
2
2
 
3
+ # Version 1.5.4 (2024-12-19)
4
+
5
+ - Fix `authenticate` / `authentication` configuration [#481](https://github.com/powerhome/audiences/pull/481)
6
+ - Paginage user requests in audiences instead of SCIM [#507](https://github.com/powerhome/audiences/pull/507)
7
+
3
8
  # Version 1.5.3 (2024-12-19)
4
9
 
5
10
  - Rollback breaking change introduced by 1.5.1 [#479](https://github.com/powerhome/audiences/pull/479)
data/docs/README.md CHANGED
@@ -30,8 +30,8 @@ An audience is tied to an owning model within your application. In this document
30
30
 
31
31
  This can be done with an unobtrusive JS renderer like `react-rails` or a custom one as shown in [our dummy app](../audiences/spec/dummy/app/frontend/entrypoints/application.js). The editor requires two arguments:
32
32
 
33
- - The context URI: `audience_context_url(owner, relation)` helper
34
- - The SCIM endpoint: `audience_scim_proxy_url` helper if using the [proxy](#configuring-the-scim-proxy), or the SCIM endpoint directly.
33
+ - The audiences mount point: `audiences.root_url` URL helper
34
+ - The context signed key: I.e.: `owner.members_signed_key` or `Audiences::Context.for(owner, relation:).signed_key`
35
35
 
36
36
  ### Configuring Audiences
37
37
 
@@ -25,18 +25,18 @@ module Audiences
25
25
  # I.e.:
26
26
  #
27
27
  # Audiences.configure do |config|
28
- # config.authentication = ->(*) { authenticate_request }
28
+ # config.authenticate = ->(*) { authenticate_request }
29
29
  # end
30
30
  #
31
31
  # I.e:
32
32
  #
33
33
  # Audiences.configure do |config|
34
- # config.authentication = ->(request) do
34
+ # config.authenticate = ->(request) do
35
35
  # request.env["warden"].authenticate!
36
36
  # end
37
37
  # end
38
38
  #
39
- config_accessor :authentication do
39
+ config_accessor :authenticate do
40
40
  ->(*) { true }
41
41
  end
42
42
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Audiences
4
- VERSION = "1.5.3"
4
+ VERSION = "1.5.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audiences
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Palhares
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-31 00:00:00.000000000 Z
11
+ date: 2025-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails