Commit 123090e
Changed files (3)
lib
scim
spec
scim
lib/scim/shady/builders/service_provider_configuration.rb
@@ -10,6 +10,11 @@ module Scim
yield @bulk
end
+ def filter
+ @filter = Filter.new
+ yield @filter
+ end
+
def build
Scim::Shady::ServiceProviderConfiguration.new(to_json)
end
@@ -22,12 +27,12 @@ module Scim
{
'schemas' => [Schemas::SERVICE_PROVIDER_CONFIG],
'documentationUri' => documentation_uri,
- 'patch' => {
- "supported" => patch
- },
+ 'patch' => { "supported" => patch },
'bulk' => @bulk.to_h,
+ 'filter' => @filter.to_h,
}
end
+
class Bulk
attr_accessor :supported
attr_accessor :max_operations
@@ -41,6 +46,18 @@ module Scim
}
end
end
+
+ class Filter
+ attr_accessor :supported
+ attr_accessor :max_results
+
+ def to_h
+ {
+ 'supported' => supported,
+ 'maxResults' => max_results,
+ }
+ end
+ end
end
end
end
lib/scim/shady/service_provider_configuration.rb
@@ -25,6 +25,14 @@ module Scim
to_h['bulk']['maxPayloadSize']
end
+ def filter_supported
+ to_h['filter']['supported']
+ end
+
+ def filter_max_results
+ to_h['filter']['maxResults']
+ end
+
def to_h
@hash ||= JSON.parse(to_json)
end
spec/scim/builders/service_provider_configuration_spec.rb
@@ -29,5 +29,15 @@ RSpec.describe Scim::Shady::Builders::ServiceProviderConfiguration do
expect(result.bulk_max_operations).to eql(1_000)
expect(result.bulk_max_payload_size).to eql(1_048_576)
end
+
+ it 'can configure filter support' do
+ subject.filter do |x|
+ x.supported = true
+ x.max_results = 200
+ end
+ result = subject.build
+ expect(result.filter_supported).to be(true)
+ expect(result.filter_max_results).to eql(200)
+ end
end
end