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 +4 -4
- data/app/models/audiences/context/locating.rb +1 -1
- data/app/models/audiences/external_user.rb +5 -3
- data/config/routes.rb +2 -11
- data/docs/CHANGELOG.md +5 -0
- data/docs/README.md +2 -2
- data/lib/audiences/configuration.rb +3 -3
- data/lib/audiences/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd59db4417464971778494de7c990f84e60c53437f2fe42539f346982ccbfb78
|
4
|
+
data.tar.gz: '048a21bed0712f1319b0a307a7d673e90ebdb1e8bf2dbff83e07866ffe642e2b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46734c2a07e2c7613a686371e3b65a22db975bfd857ef1ea6a10785ea65399016394802046018b94eb84a9c2fbd95c66469f28ce4620a35c24ec6f2da4af71bd
|
7
|
+
data.tar.gz: d246e5e8636ffaded7bb3ae150d3df5cc185c8223f526c6cecb578f51810597098241c47f25a1b5e625bc45f8395a88b7aa6da852e519efc8d92d35b12cddced
|
@@ -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
|
-
|
17
|
-
|
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
|
34
|
-
- The
|
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.
|
28
|
+
# config.authenticate = ->(*) { authenticate_request }
|
29
29
|
# end
|
30
30
|
#
|
31
31
|
# I.e:
|
32
32
|
#
|
33
33
|
# Audiences.configure do |config|
|
34
|
-
# config.
|
34
|
+
# config.authenticate = ->(request) do
|
35
35
|
# request.env["warden"].authenticate!
|
36
36
|
# end
|
37
37
|
# end
|
38
38
|
#
|
39
|
-
config_accessor :
|
39
|
+
config_accessor :authenticate do
|
40
40
|
->(*) { true }
|
41
41
|
end
|
42
42
|
|
data/lib/audiences/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2025-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|