Skip to content

ringcentral-ruby/lita-glip

Repository files navigation

Lita Glip Adapter

Gem Version Build Status Coverage Status Dependency Status Codacy Badge Code Climate Scrutinizer Code Quality Downloads Docs License

Stack Overflow Chat

lita-glip is an adapter for Lita that allows you to use the robot with Glip.

Installation

Add lita-glip to your Lita instance's Gemfile:

gem "lita-glip"

Configuration

The Lita adapter does not support the Glip interactive bot provisioning process yet. This is because the process requires a publicly accessible OAuth redirect URL and it appears this is supported only for handlers and not adapters at the moment. To configure Lita, do the following:

  • Use a stand-in bot to get permanent bot access token to use in the Lita config like glipbot_auth
  • Use username/password credentials for a user extension. This is deprecated and not recommended but can be easier than setting up a stand-in bot.

Direct

Lita.configure do |config|
  config.robot.adapter = :glip

  # Glip app info
  config.adapters.glip.app_key = 'my_app_key'
  config.adapters.glip.app_secret = 'my_app_secret'
  config.adapters.glip.server_url = 'https://platform.devtest.ringcentral.com'
  config.adapters.glip.token = {"access_token":"DEADBEEF","token_type":"bearer","expiry":"2085-11-06T01:35:52.873185841-08:00"}
end

Dotenv

Using LitaDotenv you can use the following:

require 'lita_dotenv'

Lita.configure do |config|
  config = LitaDotenv.new(config).config
end

In your .env file:

LITA_ROBOT_ADAPTER__TYPESYM=glip

LITA_ADAPTERS_GLIP_appKey=my_app_key
LITA_ADAPTERS_GLIP_appSecret=my_app_secret
LITA_ADAPTERS_GLIP_serverUrl=https://platform.devtest.ringcentral.com
LITA_ADAPTERS_GLIP_TOKEN={"access_token":"DEADBEEF","token_type":"bearer","expiry":"2085-11-06T01:35:52.873185841-08:00"}

Username/Password Approach

Use the following in your Lita Config and .env file to configure the bot using a user extension:

Lita Config

  config.adapters.glip.username = '16505550100'
  config.adapters.glip.extension = '101'
  config.adapters.glip.password = 'my_password'

.env. file:

LITA_ADAPTERS_GLIP_USERNAME=16505550100
LITA_ADAPTERS_GLIP_EXTENSION=101
LITA_ADAPTERS_GLIP_PASSWORD=my_password

API documentation

The API documentation, useful for plugin authors, can be found for the latest gem release on RubyDoc.info.

To Do

  1. User address book lookup.

Change Log

See CHANGELOG.md

Links

Project Repo

Lita

Contributing

  1. Fork it ( http://github.com/ringcentral-ruby/lita-glip/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Lita Glip Adapter is available under the MIT license. See LICENSE.md for details.

Lita Glip Adapter © 2016-2017 by John Wang