class Scim::Kit::V2::ServiceProviderConfiguration

Represents a scim Service Provider Configuration

Attributes

authentication_schemes[RW]
bulk[RW]
change_password[RW]
documentation_uri[RW]
etag[RW]
filter[RW]
meta[RW]
patch[RW]
sort[RW]

Public Class Methods

new( location:, meta: Meta.new('ServiceProviderConfig', location) ) click to toggle source
# File lib/scim/kit/v2/service_provider_configuration.rb, line 14
def initialize(
  location:,
  meta: Meta.new('ServiceProviderConfig', location)
)
  @meta = meta
  @authentication_schemes = []
  @etag = Supportable.new
  @sort = Supportable.new
  @change_password = Supportable.new
  @patch = Supportable.new
  @bulk = Supportable.new(:max_operations, :max_payload_size)
  @filter = Supportable.new(:max_results)
end
parse(json, hash = JSON.parse(json, symbolize_names: true)) click to toggle source
# File lib/scim/kit/v2/service_provider_configuration.rb, line 35
def parse(json, hash = JSON.parse(json, symbolize_names: true))
  x = new(location: hash[:location], meta: Meta.from(hash[:meta]))
  x.documentation_uri = hash[:documentationUri]
  %i[patch changePassword sort etag filter bulk].each do |key|
    x.send("#{key.to_s.underscore}=", Supportable.from(hash[key]))
  end
  schemes = hash[:authenticationSchemes]
  x.authentication_schemes = schemes&.map do |auth|
    AuthenticationScheme.from(auth)
  end
  x
end

Public Instance Methods

add_authentication(type, primary: nil) { |scheme| ... } click to toggle source
# File lib/scim/kit/v2/service_provider_configuration.rb, line 28
def add_authentication(type, primary: nil)
  scheme = AuthenticationScheme.build_for(type, primary: primary)
  yield scheme if block_given?
  @authentication_schemes << scheme
end