class Github::Authorizations::App

def create(*args)

Other tags:
    Api: - public

Options Hash: (**params)
  • :note_url (String) --
  • :note (String) --
  • :scopes (Array) --
  • client_secret (String) --

Parameters:
  • params (Hash) --
def create(*args)
  raise_authentication_error unless authenticated?
  arguments(args, required: [:client_id]) do
    sift Authorizations::VALID_AUTH_PARAM_NAMES
  end
  if client_id
    put_request("/authorizations/clients/#{client_id}", arguments.params)
  else
    raise raise_app_authentication_error
  end
end

def delete(*args)

Other tags:
    Api: - public
def delete(*args)
  raise_authentication_error unless authenticated?
  params = arguments(args, required: [:client_id]).params
  if client_id
    if access_token = (params.delete('access_token') || args[1])
      delete_request("/applications/#{client_id}/tokens/#{access_token}", params)
    else
      # Revokes all tokens
      delete_request("/applications/#{client_id}/tokens", params)
    end
  else
    raise raise_app_authentication_error
  end
end

def raise_app_authentication_error

def raise_app_authentication_error
  raise ArgumentError, 'To create authorization for the app, ' +
    'you need to provide client_id argument and client_secret parameter'
end