Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hennevogel committed Nov 8, 2023
1 parent ca42eff commit 81b7f80
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 37 deletions.
8 changes: 0 additions & 8 deletions config/initializers/filter_parameter_logging.rb

This file was deleted.

16 changes: 0 additions & 16 deletions config/initializers/inflections.rb

This file was deleted.

16 changes: 3 additions & 13 deletions lib/obs.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'faraday'

# HTTP OBS client for searches
module OBS
# Error class for unsupported search terms
Expand Down Expand Up @@ -120,13 +118,9 @@ def self.configure
yield(@configuration) if block_given?

self.client = Faraday.new(@configuration.api_host) do |conn|
conn.basic_auth @configuration.api_username, @configuration.api_password
conn.request :url_encoded
conn.response :logger, Rails.logger, headers: false
conn.request :authorization, :basic, @configuration.api_username, @configuration.api_password
conn.response :mashify, mash_class: Response
conn.response :raise_error
conn.use FaradayMiddleware::ParseXml, content_type: /\bxml$/
conn.adapter @configuration.adapter
conn.response :xml

conn.headers['User-Agent'] = 'software.o.o'
conn.headers['X-Username'] = @configuration.api_username
Expand All @@ -140,11 +134,7 @@ def self.client

# HTTP client configuration wrapper
class Configuration
attr_accessor :api_host, :api_username, :api_password, :opensuse_cookie, :adapter

def initialize
@adapter = Faraday.default_adapter
end
attr_accessor :api_host, :api_username, :api_password, :opensuse_cookie
end

# Searches for published binaries
Expand Down

0 comments on commit 81b7f80

Please sign in to comment.