From fe1dcae4b98029ec1b3f3c70a9bbf4082c1d30a7 Mon Sep 17 00:00:00 2001 From: Fernando Schuindt Date: Wed, 26 Apr 2017 23:09:11 -0300 Subject: [PATCH] Fix README small issues --- README.md | 30 ++++++++++++++++++------------ lib/firebase_id_token/version.rb | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ebd337d..6fae50c 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ gem install firebase_id_token or in your Gemfile ``` -gem 'firebase_id_token' +gem 'firebase_id_token', '~> 1.2.1' ``` then ``` @@ -62,7 +62,7 @@ In this case you must have the gem `redis` in your `Gemfile`. ```ruby FirebaseIdToken.configure do |config| config.project_ids = ['your-firebase-project-id'] - congig.redis = Redis.new(:host => "10.0.1.1", :port => 6380, :db => 15) + congig.redis = Redis.new(host: '10.0.1.1', port: 6380, db: 15) end ``` @@ -86,24 +86,30 @@ FirebaseIdToken::Certificates.request_anyway Google give us information about the certificates expiration time, it's used to set a Redis TTL (Time-To-Live) when saving it. By doing so, the certificates will be automatically deleted after it's expiration. -You can access informations about it: +#### Certificates Info + +Checks the presence of certificates in Redis database. ```ruby -# Boolean representing the presence of certificates in Redis database. FirebaseIdToken::Certificates.present? => true +``` -# How many seconds until the certificates expiration. +How many seconds until the certificates expiration. +```ruby FirebaseIdToken::Certificates.ttl => 22352 +``` -# List of all certificates in database. +Lists all certificates in database. +```ruby FirebaseIdToken::Certificates.all -=> [{"ec8f292sd30224afac5c55540df66d1f999d" => [{"ec8f292sd30224afac5c55540df66d1f999d" => ``` #### Downloading in Rails @@ -129,7 +135,7 @@ Pass the Firebase ID Token to `FirebaseIdToken::Signature.verify` and it will re ```ruby FirebaseIdToken::Signature.verify(token) -=> {"iss"=>"https://securetoken.google.com/firebase-id-token", "name"=>"Bob Test", [...] +=> {"iss"=>"https://securetoken.google.com/firebase-id-token", "name"=>"Bob Test", [...]} ``` When either the signature is false or the token is invalid, it will return `nil`: @@ -145,7 +151,7 @@ FirebaseIdToken::Signature.verify('aaaaaa') #### Payload Structure -In case you need, here's a example of the payload structure in JSON. +In case you need, here's a example of the payload structure from a Google login in JSON. ```json { "iss":"https://securetoken.google.com/firebase-id-token", diff --git a/lib/firebase_id_token/version.rb b/lib/firebase_id_token/version.rb index 06f0925..dcd0699 100644 --- a/lib/firebase_id_token/version.rb +++ b/lib/firebase_id_token/version.rb @@ -1,3 +1,3 @@ module FirebaseIdToken - VERSION = "1.2.0" + VERSION = "1.2.1" end