Sha256: fc002150f5083332cca63eb66167d41de17e99369e8d81d2d0ecd23524b0d8c0

Contents?: true

Size: 777 Bytes

Versions: 7

Compression:

Stored size: 777 Bytes

Contents

require "aruba/cucumber"
require "json_spec/cucumber"
require 'cucumber-api'
require 'addressable/uri'

$LOAD_PATH.unshift File.expand_path('../..', File.dirname(__FILE__))

# Overwrite cucumber-api's resolve function so it will use the scheme
# and host from ENV['CONJUR_APPLIANCE_URL'] if url doesn't already
# have a host.
$orig_resolve = self.method(:resolve)
def resolve url
  # disable cucumber-api's ill-considered cache. Re-authenticate in
  # case it (cucumber-api) wiped out the headers
  $cache = {} 
  add_user_auth_header
  url = Addressable::URI.parse(url)
  unless url.host
    conjur_url = Addressable::URI.parse(Conjur.configuration.appliance_url)
    url.merge!(:scheme => conjur_url.scheme, :host => conjur_url.host)
  end
  $orig_resolve.call(url.to_s)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
conjur-cli-5.6.6 acceptance-features/support/env.rb
conjur-cli-5.6.5 acceptance-features/support/env.rb
conjur-cli-5.6.4 acceptance-features/support/env.rb
conjur-cli-5.6.3 acceptance-features/support/env.rb
conjur-cli-5.5.0 acceptance-features/support/env.rb
conjur-cli-5.4.0 acceptance-features/support/env.rb
conjur-cli-5.3.0 acceptance-features/support/env.rb