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 =
'2.4.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


51
52
53
# File 'lib/firebase_id_token.rb', line 51

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

Class Method Details

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

Yields:


60
61
62
# File 'lib/firebase_id_token.rb', line 60

def self.configure
  yield configuration
end

.resetObject

Resets Configuration to defaults.


56
57
58
# File 'lib/firebase_id_token.rb', line 56

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

73
74
75
76
# File 'lib/firebase_id_token.rb', line 73

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