Module: Tacokit::Authorization

Included in:
Client
Defined in:
lib/tacokit/authorization.rb

Instance Method Summary collapse

Instance Method Details

#authorize(params = {}) ⇒ Object

Get a token for making authorized requests to the Trello API

Parameters:

  • params (Hash) (defaults to: {})

    Repository information to update

Options Hash (params):

  • :name (String)

    Name of the application

  • :key (String)

    Application key

  • :callback_method (String)

    “postMessage” or “fragment”

  • :return_url (String)

    URL the token should be returned to

  • :scope (String)

    Comma-separated list of one or more of “read”, “write”, “account”

  • :expiration (String)

    “1hour”, “1day”, “30days”, “never”

See Also:


17
18
19
# File 'lib/tacokit/authorization.rb', line 17

def authorize(params = {})
  open_url authorize_url(params)
end

#authorize_url(params = {}) ⇒ Object


21
22
23
24
25
26
# File 'lib/tacokit/authorization.rb', line 21

def authorize_url(params = {})
  params[:key] ||= app_key
  params[:name] ||= "Tacokit"
  params[:response_type] ||= "token"
  web_url "authorize", params
end

#get_app_keyObject

rubocop:disable Style/AccessorMethodName


3
4
5
# File 'lib/tacokit/authorization.rb', line 3

def get_app_key # rubocop:disable Style/AccessorMethodName
  open_url web_url("app-key")
end