class Artifactory::Resource::LDAPSetting

def all(options = {})

Returns:
  • (Array) -

Options Hash: (**options)
  • :client (Artifactory::Client) --

Parameters:
  • options (Hash) --
def all(options = {})
  config = Resource::System.configuration(options)
  list_from_config("config/security/ldapSettings/ldapSetting", config, options)
end

def find(name, options = {})

Returns:
  • (Resource::LDAPSetting, nil) -

Options Hash: (**options)
  • :client (Artifactory::Client) --

Parameters:
  • options (Hash) --
  • name (String) --

Other tags:
    Example: Find an LDAPSetting by its name. -
def find(name, options = {})
  config = Resource::System.configuration(options)
  find_from_config("config/security/ldapSettings/ldapSetting/key[text()='#{name}']", config, options)
rescue Error::HTTPError => e
  raise unless e.code == 404
  nil
end

def find_from_config(xpath, config, options = {})

Parameters:
  • options (Hash) --
  • config (REXML) --
  • xpath (String) --
def find_from_config(xpath, config, options = {})
  name_node = REXML::XPath.match(config, xpath)
  return nil if name_node.empty?
  properties = Util.xml_to_hash(name_node[0].parent, "search")
  from_hash(properties, options)
end

def list_from_config(xpath, config, options = {})

Parameters:
  • options (Hash) --
  • config (REXML) --
  • xpath (String) --
def list_from_config(xpath, config, options = {})
  REXML::XPath.match(config, xpath).map do |r|
    hash = Util.xml_to_hash(r, "search")
    from_hash(hash, options)
  end
end