Module: FirebaseIdToken

Defined in:
lib/firebase_id_token.rb,
lib/firebase_id_token/version.rb,
lib/firebase_id_token/signature.rb,
lib/firebase_id_token/certificates.rb,
lib/firebase_id_token/configuration.rb,
lib/firebase_id_token/testing/certificates.rb,
lib/firebase_id_token/exceptions/certificate_not_found.rb,
lib/firebase_id_token/exceptions/no_certificates_error.rb,
lib/firebase_id_token/exceptions/certificates_ttl_error.rb,
lib/firebase_id_token/exceptions/certificates_request_error.rb

Overview

List of available methods

Configuration

You need to set your Firebase Project ID. Additionally you can set your Redis server instance in case you don't use Redis defaults.

WARNING: Your project_ids must be a Array.

FirebaseIdToken.configure do |config|
  config.project_ids = ['my-project-id', 'another-project-id']
  congig.redis = Redis.new(:host => "10.0.1.1", :port => 6380, :db => 15)
end

Defaults

  • project_ids => []
  • redis => Redis.new

Defined Under Namespace

Modules: Exceptions, Testing Classes: Certificates, Configuration, Signature

Constant Summary collapse

VERSION =
'3.0.0'
LIB_PATH =

Handles the configuration object. Check out FirebaseIdToken for more info on how to use it.

File.expand_path('../../', __FILE__)

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject



53
54
55
# File 'lib/firebase_id_token.rb', line 53

def self.configuration
  @configuration ||= Configuration.new
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



62
63
64
# File 'lib/firebase_id_token.rb', line 62

def self.configure
  yield configuration
end

.resetObject

Resets Configuration to defaults.



58
59
60
# File 'lib/firebase_id_token.rb', line 58

def self.reset
  @configuration = Configuration.new
end

.test!Object

Method for starting test mode. You can verify with a test certificate or you can use a test private key to verify the token. When using, write it at the beginning of the test.

Examples:

class ActiveSupport::TestCase
  setup do
    FirebaseIdToken.test!
  end
end


75
76
77
78
# File 'lib/firebase_id_token.rb', line 75

def self.test!
  require 'firebase_id_token/testing/certificates'
  self.configuration.certificates = FirebaseIdToken::Testing::Certificates
end