Class: Trello::Authorization::BasicAuthPolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/trello/authorization.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.developer_public_keyObject

Returns the value of attribute developer_public_key.



11
12
13
# File 'lib/trello/authorization.rb', line 11

def developer_public_key
  @developer_public_key
end

.member_tokenObject

Returns the value of attribute member_token.



11
12
13
# File 'lib/trello/authorization.rb', line 11

def member_token
  @member_token
end

Class Method Details

.authorize(request) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/trello/authorization.rb', line 13

def authorize(request)
  the_uri = Addressable::URI.parse(request.uri)
  existing_values = the_uri.query_values.nil? ? {} : the_uri.query_values
  new_values = { :key => @developer_public_key, :token => @member_token }
  the_uri.query_values = new_values.merge existing_values

  Request.new request.verb, the_uri, request.headers
end