123456789_123456789_123456789_123456789_123456789_

Class: Octokit::EnterpriseManagementConsoleClient

Relationships & Source Files
Namespace Children
Modules:
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
Inherits: Object
Defined in: lib/octokit/enterprise_management_console_client.rb,
lib/octokit/enterprise_management_console_client/management_console.rb

Overview

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

Constant Summary

Authentication - Included

FARADAY_BASIC_AUTH_KEYS

Connection - Included

CONVENIENCE_HEADERS

Class Method Summary

Instance Attribute Summary

Authentication - Included

#application_authenticated?

Indicates if the client has OAuth Application client_id and secret credentials to make anonymous requests at a higher rate limit.

#basic_authenticated?

Indicates if the client was supplied Basic Auth username and password.

#bearer_authenticated?

Indicates if the client was supplied a bearer token.

#token_authenticated?

Indicates if the client was supplied an OAuth access token.

#user_authenticated?

Indicates if the client was supplied an OAuth access token or Basic Auth username and password.

Configurable - Included

Instance Method Summary

ManagementConsole - Included

#add_authorized_key

Add an authorized SSH keys on the Enterprise install.

#authorized_keys

Fetch the authorized SSH keys on the Enterprise install.

#config_check
#config_status

Get information about the Enterprise installation.

#delete_authorized_key
#edit_maintenance_status
#edit_settings

Modify the Enterprise settings.

#get_authorized_keys
#get_maintenance_status
#get_settings
#maintenance_status

Get information about the Enterprise maintenance status.

#remove_authorized_key

Removes an authorized SSH keys from the Enterprise install.

#set_maintenance_status

Start (or turn off) the Enterprise maintenance mode.

#settings

Get information about the Enterprise installation.

#start_configuration

Start a configuration process.

#upgrade

Upgrade an Enterprise installation.

#upload_license

Uploads a license for the first time.

Warnable - Included

#octokit_warn

Wrapper around Kernel#warn to print warnings unless OCTOKIT_SILENT is set to true.

Connection - Included

#agent

Hypermedia agent for the GitHub API.

#delete

Make a HTTP DELETE request.

#get

Make a HTTP GET request.

#head

Make a HTTP HEAD request.

#last_response

Response for last HTTP request.

#paginate

Make one or more HTTP GET requests, optionally fetching the next page of results from URL in Link response header based on value in #auto_paginate.

#patch

Make a HTTP PATCH request.

#post

Make a HTTP POST request.

#put

Make a HTTP PUT request.

#root

Fetch the root resource for the API.

#boolean_from_response

Executes the request, checking if it was successful.

#parse_query_and_convenience_headers, #request, #reset_agent, #sawyer_options

Authentication - Included

Configurable - Included

#configure

Set configuration options using a block.

#reset!

Reset configuration options to default values.

#same_options?

Compares client options to a Hash of requested options.

#setup
#fetch_client_id_and_secret, #options

Constructor Details

.new(options = {}) ⇒ EnterpriseManagementConsoleClient

[ GitHub ]

  
# File 'lib/octokit/enterprise_management_console_client.rb', line 21

def initialize(options = {})
  # Use options passed in, but fall back to module defaults
  # rubocop:disable Style/HashEachMethods
  #
  # This may look like a `.keys.each` which should be replaced with `#each_key`, but
  # this doesn't actually work, since `#keys` is just a method we've defined ourselves.
  # The class doesn't fulfill the whole `Enumerable` contract.
  Octokit::Configurable.keys.each do |key|
    # rubocop:enable Style/HashEachMethods
    instance_variable_set(:"@#{key}", options[key] || Octokit.instance_variable_get(:"@#{key}"))
  end
end

Instance Method Details

#faraday_configuration (private)

We fall back to raw Faraday for handling the licenses because I'm suspicious that Sawyer isn't handling binary POSTs correctly: https://github.com/lostisland/sawyer/blob/03fca4c020f465ec42856d0486ec3991859b0aed/lib/sawyer/agent.rb#L85

[ GitHub ]

  
# 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 connection_options[:ssl] && !connection_options[:ssl][:verify]
      http.ssl[:verify] = false
    end

    http.use Octokit::Response::RaiseError
    http.adapter Faraday.default_adapter
  end
end

#password_hash (private)

[ GitHub ]

  
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 154

def password_hash
  { query: { api_key: @management_console_password } }
end