Sha256: 90d85597da33f34a06494574e4e9b29267e369528336121f761d9b896646c26a

Contents?: true

Size: 862 Bytes

Versions: 2

Compression:

Stored size: 862 Bytes

Contents

module Conjur
  class WebService < RestClient::Resource
    include ActsAsAsset
    
    def add_client(member)
      RestClient::Resource.new(self["clients"].url, self.options).post(id: member)
    end
 
    def remove_client(member)
      RestClient::Resource.new(self["clients/#{fully_escape member}"].url, self.options).delete
    end
    
    def credential_variable
      Conjur::Variable.new(Conjur::Core::API.host, self.options)["variables/#{credentialid}"]
    end
    
    def credential(version=nil)
      url = 'credential'
      url << "?version=#{version}" if version
      self[url].get.body
    end
    
    def credential=(value)
      self["credential"].put(value)
    end
    
    def credentialid
      attributes['credentialid']
    end
    
    def validate_url(url)
      self["validate_url?url=#{query_escape url}"].get
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
conjur-asset-service-gateway-api-0.5.3 lib/conjur/web_service.rb
conjur-asset-service-gateway-api-0.5.2 lib/conjur/web_service.rb