Commit 15c1a51
Changed files (3)
lib
scim
spec
scim
lib/scim/shady/builders/service_provider_configuration.rb
@@ -4,6 +4,7 @@ module Scim
class ServiceProviderConfiguration
attr_accessor :documentation_uri
attr_accessor :patch
+ attr_accessor :change_password_supported
def bulk
@bulk = Bulk.new
@@ -30,6 +31,9 @@ module Scim
'patch' => { "supported" => patch },
'bulk' => @bulk.to_h,
'filter' => @filter.to_h,
+ 'changePassword' => {
+ 'supported' => change_password_supported,
+ }
}
end
lib/scim/shady/service_provider_configuration.rb
@@ -33,6 +33,10 @@ module Scim
to_h['filter']['maxResults']
end
+ def change_password_supported
+ to_h['changePassword']['supported']
+ end
+
def to_h
@hash ||= JSON.parse(to_json)
end
spec/scim/builders/service_provider_configuration_spec.rb
@@ -39,5 +39,11 @@ RSpec.describe Scim::Shady::Builders::ServiceProviderConfiguration do
expect(result.filter_supported).to be(true)
expect(result.filter_max_results).to eql(200)
end
+
+ it 'can configure change password support' do
+ subject.change_password_supported = true
+ result = subject.build
+ expect(result.change_password_supported).to be(true)
+ end
end
end