Class: PasswordCredentials

Inherits:
Credentials show all
Defined in:
lib/jirarest2/password_credentials.rb

Overview

A Credentials object contains the data required to connect to a JIRA(tm) instance.

Instance Attribute Summary collapse

Attributes inherited from Credentials

#baseurl, #connecturl, #username

Instance Method Summary collapse

Constructor Details

#initialize(url, username, password) ⇒ PasswordCredentials

Returns a new instance of PasswordCredentials.

Parameters:

  • url (String)

    URL to JIRA(tm) instance

  • username (String)
  • password (String)


30
31
32
33
# File 'lib/jirarest2/password_credentials.rb', line 30

def initialize(url,username,password)
  super(url,username)
  @password = password
end

Instance Attribute Details

#passwordObject

password for the connection



25
26
27
# File 'lib/jirarest2/password_credentials.rb', line 25

def password
  @password
end

Instance Method Details

#get_auth_header(request) ⇒ Object

Get the auth header to send to the server

Parameters:

  • request (Net:::HTTP::Post, Net:::HTTP::Put, Net:::HTTP::Get, Net:::HTTP::Delete)

    Request object



37
38
39
# File 'lib/jirarest2/password_credentials.rb', line 37

def get_auth_header(request)
  request.basic_auth  @username, @password
end