0.0
No commit activity in last 3 years
No release in over 3 years
LondonCab Authentication Client
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 9.0
~> 10.0
~> 3.0
~> 0.47.1

Runtime

 Project Readme

LondonCab::Auth

Gem Version Build Status Code Climate

An authentication extension for london_cab.

Installation

Add this line to your application's Gemfile:

gem 'london_cab-auth'

And then execute:

$ bundle

Or install it yourself as:

$ gem install london_cab-auth

Usage

API Token

To acquire an API token, use the same credentials for your corporate London Cab account.

Configuration

LondonCab::Auth.configure do |config|
  config.username = ENV['LONDON_CAB_API_AUTH_USERNAME']
  config.password = ENV['LONDON_CAB_API_AUTH_PASSWORD']
end

This sets a global default username and password. You can also pass a username and password to the initializer of LondonCab::Auth::Client.

client = LondonCab::Auth::Client.new(username: ENV['LONDON_CAB_API_AUTH_USERNAME'],
                                     password: ENV['LONDON_CAB_API_AUTH_PASSWORD'])

The instance username and password will be used over the global default.

The following globals settings are supported via LondonCab::Auth.configure.

setting description
username London Cab API Auth username.
password London Cab API Auth password.
logger An optional logger.
Default: Logger.new(STDOUT) at Logger::WARN level.

Client

The London Cab Auth allows you to generate tokens that can be used with the London Cab API client.

Configuration

setting description
endpoint London Cab Auth endpoint.
Default: http://65.182.108.16:22710
user_agent User-agent.
Default: LondonCab::Auth/VERSION.
username Required. London Cab API Auth username.
password Required. London Cab API Auth password.
logger Optional. Logger instance that logs HTTP requests.

Documentation

Auth

You can use the client to make requests related to auth.

Generate Auth

Request rides with #auth.

client.auth

History

The structure of this gem is based on slack-ruby-client.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/RaMin0/london_cab-auth.