Module: Octokit::Authentication

Included in:
Client, Connection
Defined in:
lib/octokit/authentication.rb

Overview

Authentication methods for Client

Instance Method Summary collapse

Instance Method Details

#application_authenticated?Boolean

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



47
48
49
# File 'lib/octokit/authentication.rb', line 47

def application_authenticated?
  !!application_authentication
end

#basic_authenticated?Boolean

Indicates if the client was supplied Basic Auth username and password



11
12
13
# File 'lib/octokit/authentication.rb', line 11

def basic_authenticated?
  !!(@login && @password)
end

#bearer_authenticated?Boolean

Indicates if the client was supplied a bearer token



28
29
30
# File 'lib/octokit/authentication.rb', line 28

def bearer_authenticated?
  !!@bearer_token
end

#token_authenticated?Boolean

Indicates if the client was supplied an OAuth access token



20
21
22
# File 'lib/octokit/authentication.rb', line 20

def token_authenticated?
  !!@access_token
end

#user_authenticated?Boolean

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



37
38
39
# File 'lib/octokit/authentication.rb', line 37

def user_authenticated?
  basic_authenticated? || token_authenticated?
end