123456789_123456789_123456789_123456789_123456789_

Module: Octokit::Default

Relationships & Source Files
Defined in: lib/octokit/default.rb

Overview

Default configuration options for Client

Constant Summary

Class Method Summary

Class Method Details

.access_tokenString

Default access token from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 59

def access_token
  ENV.fetch('OCTOKIT_ACCESS_TOKEN', nil)
end

.api_endpointString

Default API endpoint from ENV or API_ENDPOINT

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 65

def api_endpoint
  ENV.fetch('OCTOKIT_API_ENDPOINT') { API_ENDPOINT }
end

.auto_paginateString

Default pagination preference from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 71

def auto_paginate
  ENV.fetch('OCTOKIT_AUTO_PAGINATE', nil)
end

.bearer_tokenString

Default bearer token from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 77

def bearer_token
  ENV.fetch('OCTOKIT_BEARER_TOKEN', nil)
end

.client_idString

Default OAuth app key from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 83

def client_id
  ENV.fetch('OCTOKIT_CLIENT_ID', nil)
end

.client_secretString

Default OAuth app secret from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 89

def client_secret
  ENV.fetch('OCTOKIT_SECRET', nil)
end

.connection_optionsHash

Default options for Faraday::Connection

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 125

def connection_options
  {
    headers: {
      accept: default_media_type,
      user_agent: user_agent
    }
  }
end

.default_media_typeString

Default media type from ENV or MEDIA_TYPE

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 136

def default_media_type
  ENV.fetch('OCTOKIT_DEFAULT_MEDIA_TYPE') { MEDIA_TYPE }
end

.loginString

Default GitHub username for Basic Auth from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 142

def 
  ENV.fetch('OCTOKIT_LOGIN', nil)
end

.manage_ghes_endpointString

Default GHES Manage API endpoint from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 107

def manage_ghes_endpoint
  ENV.fetch('OCTOKIT_MANAGE_GHES_ENDPOINT', nil)
end

.manage_ghes_passwordString

Default GHES Manage API password from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 119

def manage_ghes_password
  ENV.fetch('OCTOKIT_MANAGE_GHES_PASSWORD', nil)
end

.manage_ghes_usernameString

Default GHES Manage API username from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 113

def manage_ghes_username
  ENV.fetch('OCTOKIT_MANAGE_GHES_USERNAME', nil)
end

.management_console_endpointString

Default management console endpoint from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 101

def management_console_endpoint
  ENV.fetch('OCTOKIT_ENTERPRISE_MANAGEMENT_CONSOLE_ENDPOINT', nil)
end

.management_console_passwordString

Default management console password from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 95

def management_console_password
  ENV.fetch('OCTOKIT_ENTERPRISE_MANAGEMENT_CONSOLE_PASSWORD', nil)
end

.middlewareFaraday::RackBuilder or Faraday::Builder

Default middleware stack for Faraday::Connection from MIDDLEWARE

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 149

def middleware
  MIDDLEWARE
end

.netrcBoolean

Default behavior for reading .netrc file

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 196

def netrc
  ENV.fetch('OCTOKIT_NETRC', false)
end

.netrc_fileString

Default path for .netrc file

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 202

def netrc_file
  ENV.fetch('OCTOKIT_NETRC_FILE') { File.join(Dir.home.to_s, '.netrc') }
end

.optionsHash

Configuration options

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 53

def options
  Octokit::Configurable.keys.to_h { |key| [key, send(key)] }
end

.passwordString

Default GitHub password for Basic Auth from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 155

def password
  ENV.fetch('OCTOKIT_PASSWORD', nil)
end

.per_pageInteger

Default pagination page size from ENV

Returns:

  • (Integer)

    Page size

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 161

def per_page
  page_size = ENV.fetch('OCTOKIT_PER_PAGE', nil)

  page_size&.to_i
end

.proxyString

Default proxy server URI for Faraday connection from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 169

def proxy
  ENV.fetch('OCTOKIT_PROXY', nil)
end

.ssl_verify_modeInteger

Default SSL verify mode from ENV

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 175

def ssl_verify_mode
  # 0 is OpenSSL::SSL::VERIFY_NONE
  # 1 is OpenSSL::SSL::SSL_VERIFY_PEER
  # the standard default for SSL is SSL_VERIFY_PEER which requires a server certificate check on the client
  ENV.fetch('OCTOKIT_SSL_VERIFY_MODE', 1).to_i
end

.user_agentString

Default User-Agent header string from ENV or USER_AGENT

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 184

def user_agent
  ENV.fetch('OCTOKIT_USER_AGENT') { USER_AGENT }
end

.web_endpointString

Default web endpoint from ENV or WEB_ENDPOINT

[ GitHub ]

  
# File 'lib/octokit/default.rb', line 190

def web_endpoint
  ENV.fetch('OCTOKIT_WEB_ENDPOINT') { WEB_ENDPOINT }
end