class Bugcrowd::Client

Constants

API_ENDPOINT
MEDIA_TYPE
USER_AGENT

Attributes

password[RW]
username[RW]

Public Class Methods

new(username: ENV['BUGCROWD_USER'], password: ENV['BUGCROWD_PASSWORD']) click to toggle source
# File lib/bugcrowd/client.rb, line 14
def initialize(username: ENV['BUGCROWD_USER'], password: ENV['BUGCROWD_PASSWORD'])
  self.username = username
  self.password = password
end

Public Instance Methods

connection() click to toggle source
# File lib/bugcrowd/client.rb, line 44
def connection
  @connection = Excon.new(API_ENDPOINT, connection_options)
end
connection_options() click to toggle source
# File lib/bugcrowd/client.rb, line 33
def connection_options
  {
    headers: {
      "Accept" => MEDIA_TYPE,
      "User-Agent" => USER_AGENT
    },
    user: self.username,
    password: self.password
  }
end
get(path, options = {}) click to toggle source
# File lib/bugcrowd/client.rb, line 28
def get(path, options = {})
  options.merge!(path: path)
  connection.get(options)
end
inspect() click to toggle source
Calls superclass method
# File lib/bugcrowd/client.rb, line 19
def inspect
  inspected = super

  inspected = inspected.gsub! self.username, "*******" if self.username
  inspected = inspected.gsub! self.password, "*******" if self.password

  inspected
end