Module: BitBucket::Authorization

Included in:
API
Defined in:
lib/bitbucket_rest_api/authorization.rb

Instance Method Summary collapse

Instance Method Details

#authenticated?Boolean

Check whether authentication credentials are present

Returns:

  • (Boolean)


7
8
9
# File 'lib/bitbucket_rest_api/authorization.rb', line 7

def authenticated?
  basic_authed? || oauth_token?
end

#authenticationObject

Select authentication parameters



17
18
19
20
21
22
23
24
25
# File 'lib/bitbucket_rest_api/authorization.rb', line 17

def authentication
  if basic_auth?
    { :basic_auth => basic_auth }
  elsif login? && password?
    { :login => , :password => password }
  else
    { }
  end
end

#basic_authed?Boolean

Check whether basic authentication credentials are present

Returns:

  • (Boolean)


12
13
14
# File 'lib/bitbucket_rest_api/authorization.rb', line 12

def basic_authed?
  basic_auth? || (login? && password?)
end