audiences 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/CHANGELOG.md +4 -0
- data/lib/audiences/configuration.rb +2 -1
- data/lib/audiences/scim/resource.rb +12 -2
- 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: 8f83dd42249d90e09a66c7f11b5adb821e7f0fbc3add8089f075fe2668e79d35
|
4
|
+
data.tar.gz: 351a6676df1a297b691842e06fc18b721d3581a9bdd0ea6101bce2ed81cee06e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f90802d28319f4cbc95a8be9f9f2e68115ac7142ab6fcbf4c9be0437a14a2e57b6d58632e1befeb37b19ba1b2ce9de1d6f8fc2d9b674b120ee51d240e47140dd
|
7
|
+
data.tar.gz: d70f080cdad97a5bdfc31b701d7659a300dbeeef3c380371b1d91c7198a30c4ff9899c5106a0eb2af972e8b6d53e77ab718fb962c6f8734c960375394ffa60c6
|
data/docs/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# Version 1.3.0 (2024-09-03)
|
4
|
+
|
5
|
+
- Filter out inactive users by default [#382](https://github.com/powerhome/audiences/pull/382)
|
6
|
+
|
3
7
|
# Version 1.2.2 (2024-08-21)
|
4
8
|
|
5
9
|
- Permit configured resource attributes [#375](https://github.com/powerhome/audiences/pull/375)
|
@@ -46,7 +46,8 @@ module Audiences
|
|
46
46
|
# @see `resource`.
|
47
47
|
#
|
48
48
|
config_accessor :resources do
|
49
|
-
{ Users: Scim::Resource.new(type: :Users, attributes: ["photos" => %w[type value]
|
49
|
+
{ Users: Scim::Resource.new(type: :Users, attributes: ["active", { "photos" => %w[type value] }],
|
50
|
+
filter: "active eq true") }
|
50
51
|
end
|
51
52
|
|
52
53
|
#
|
@@ -3,17 +3,20 @@
|
|
3
3
|
module Audiences
|
4
4
|
module Scim
|
5
5
|
class Resource
|
6
|
-
attr_accessor :options, :type, :attributes
|
6
|
+
attr_accessor :options, :type, :attributes, :filter
|
7
7
|
|
8
|
-
def initialize(type:, attributes: [], **options)
|
8
|
+
def initialize(type:, attributes: [], filter: nil, **options)
|
9
9
|
@type = type
|
10
10
|
@options = options
|
11
11
|
@attributes = ["id", "externalId", "displayName", *attributes]
|
12
|
+
@filter = filter
|
12
13
|
end
|
13
14
|
|
14
15
|
def query(**options)
|
16
|
+
options_filter = options.delete(:filter)
|
15
17
|
ResourcesQuery.new(Scim.client, resource: self,
|
16
18
|
attributes: scim_attributes,
|
19
|
+
filter: merged_filter(options_filter),
|
17
20
|
**@options, **options)
|
18
21
|
end
|
19
22
|
|
@@ -29,6 +32,13 @@ module Audiences
|
|
29
32
|
end
|
30
33
|
end.join(",")
|
31
34
|
end
|
35
|
+
|
36
|
+
def merged_filter(filter)
|
37
|
+
return @filter unless filter
|
38
|
+
return filter unless @filter
|
39
|
+
|
40
|
+
"(#{@filter}) and (#{filter})"
|
41
|
+
end
|
32
42
|
end
|
33
43
|
end
|
34
44
|
end
|
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.
|
4
|
+
version: 1.3.0
|
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-
|
11
|
+
date: 2024-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|