Class: Conjur::Core::API

Inherits:
API
  • Object
show all
Defined in:
lib/conjur/core-api.rb

Class Method Summary collapse

Class Method Details

.conjur_accountObject



5
6
7
# File 'lib/conjur/core-api.rb', line 5

def 
  info['account'] or raise "No account field in #{info.inspect}"
end

.default_hostObject



17
18
19
20
21
22
23
24
# File 'lib/conjur/core-api.rb', line 17

def default_host
  case Conjur.env
  when 'test', 'development'
    "http://localhost:#{Conjur.service_base_port + 200}"
  else
    "https://core-#{Conjur.}-conjur.herokuapp.com"
  end
end

.hostObject



13
14
15
# File 'lib/conjur/core-api.rb', line 13

def host
  ENV['CONJUR_CORE_URL'] || default_host
end

.infoObject



9
10
11
# File 'lib/conjur/core-api.rb', line 9

def info
  @info ||= JSON.parse RestClient::Resource.new(Conjur::Core::API.host)['info'].get
end