class Octokit::EnterpriseManagementConsoleClient

EnterpriseManagementConsoleClient is only meant to be used by GitHub Enterprise Admins and provides access to the management console API endpoints.

@see Octokit::Client Use Octokit::Client for regular API use for GitHub

and GitHub Enterprise.

@see developer.github.com/v3/enterprise-admin/management_console/

Public Class Methods

new(options = {}) click to toggle source
# File lib/octokit/enterprise_management_console_client.rb, line 21
def initialize(options = {})
  # Use options passed in, but fall back to module defaults
  Octokit::Configurable.keys.each do |key|
    instance_variable_set(:"@#{key}", options[key] || Octokit.instance_variable_get(:"@#{key}"))
  end
end

Protected Instance Methods

endpoint() click to toggle source
# File lib/octokit/enterprise_management_console_client.rb, line 30
def endpoint
  management_console_endpoint
end
management_console_endpoint=(value) click to toggle source

Set Enterprise Management Console endpoint

@param value [String] Management console endpoint

# File lib/octokit/enterprise_management_console_client.rb, line 45
def management_console_endpoint=(value)
  reset_agent
  @management_console_endpoint = value
end
management_console_password=(value) click to toggle source

Set Enterprise Management Console password

@param value [String] Management console admin password

# File lib/octokit/enterprise_management_console_client.rb, line 37
def management_console_password=(value)
  reset_agent
  @management_console_password = value
end

Private Instance Methods

faraday_configuration() click to toggle source

We fall back to raw Faraday for handling the licenses because I'm suspicious that Sawyer isn't handling binary POSTs correctly: git.io/jMir

# File lib/octokit/enterprise_management_console_client/management_console.rb, line 160
def faraday_configuration
  @faraday_configuration ||= Faraday.new(:url => @management_console_endpoint) do |http|
    http.headers[:user_agent] = user_agent
    http.request :multipart
    http.request :url_encoded

    # Disabling SSL is essential for certain self-hosted Enterprise instances
    if self.connection_options[:ssl] && !self.connection_options[:ssl][:verify]
      http.ssl[:verify] = false
    end

    http.use Octokit::Response::RaiseError
    http.adapter Faraday.default_adapter
  end
end
password_hash() click to toggle source
# File lib/octokit/enterprise_management_console_client/management_console.rb, line 154
def password_hash
  { :query => { :api_key => @management_console_password } }
end