Provides methods to decrypt data coming from The City plugin framework.
Tested with Ruby 1.9.3
Add this line to your application's Gemfile:
gem 'thecity-plugin'
And then execute:
$ bundle
Or install it yourself as:
$ gem install thecity-plugin
The City Plugin framework will post data to your plugin to identify the user and provide a key for calling further City APIs.
The data that is posted consists of two pieces of data:
- city_data - encrypted data from The City
- city_data_iv - an initialization vector used to decrypt the data (along with your app secret key)
This gem provides a method to take your city_date, city_data_iv, and secret and it decrypts and returns the data.
example usage:
$ Thecity::Plugin::decrypt_city_data(ENCRYPTED_STRING, IV, SECRET)
NOTE: SECRET is actually the first 32 characters of your secret key
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request