Module: FirebaseTokenAuth

Defined in:
lib/firebase_token_auth.rb,
lib/firebase_token_auth/client.rb,
lib/firebase_token_auth/version.rb,
lib/firebase_token_auth/validator.rb,
lib/firebase_token_auth/exceptions.rb,
lib/firebase_token_auth/admin_client.rb,
lib/firebase_token_auth/configuration.rb,
lib/firebase_token_auth/public_key_manager.rb

Defined Under Namespace

Classes: APIError, AdminClient, ArgumentError, BadGateway, BadRequest, Client, ClientError, Configuration, ConfigurationError, Conflict, Error, ExpectationFailed, FailedDependency, Forbidden, GatewayTimeout, Gone, HTTPVersionNotSupported, HttpError, IdToken, IdTokenResult, ImaTeapot, InsufficientStorage, InternalServerError, LengthRequired, Locked, LoopDetected, MethodNotAllowed, MisdirectedRequest, NetworkAuthenticationRequired, NetworkError, NotAcceptable, NotExtended, NotFound, NotImplemented, PayloadTooLarge, PaymentRequired, PreconditionFailed, PreconditionRequired, ProxyAuthenticationRequired, PublicKeyManager, RangeNotSatisfiable, RequestHeaderFieldsTooLarge, RequestTimeout, ServerError, ServiceUnavailable, TooManyRequests, URITooLong, Unauthorized, UnavailableForLegalReasons, UnprocessableEntity, UnsupportedMediaType, UpgradeRequired, ValidationError, Validator, VariantAlsoNegotiates

Constant Summary collapse

ALGORITHM =
'RS256'.freeze
VERSION =
'1.5.1'.freeze
STATUS_TO_EXCEPTION_MAPPING =
{
  '400' => BadRequest,
  '401' => Unauthorized,
  '402' => PaymentRequired,
  '403' => Forbidden,
  '404' => NotFound,
  '405' => MethodNotAllowed,
  '406' => NotAcceptable,
  '407' => ProxyAuthenticationRequired,
  '408' => RequestTimeout,
  '409' => Conflict,
  '410' => Gone,
  '411' => LengthRequired,
  '412' => PreconditionFailed,
  '413' => PayloadTooLarge,
  '414' => URITooLong,
  '415' => UnsupportedMediaType,
  '416' => RangeNotSatisfiable,
  '417' => ExpectationFailed,
  '418' => ImaTeapot,
  '421' => MisdirectedRequest,
  '422' => UnprocessableEntity,
  '423' => Locked,
  '424' => FailedDependency,
  '426' => UpgradeRequired,
  '428' => PreconditionRequired,
  '429' => TooManyRequests,
  '431' => RequestHeaderFieldsTooLarge,
  '451' => UnavailableForLegalReasons,
  '500' => InternalServerError,
  '501' => NotImplemented,
  '502' => BadGateway,
  '503' => ServiceUnavailable,
  '504' => GatewayTimeout,
  '505' => HTTPVersionNotSupported,
  '506' => VariantAlsoNegotiates,
  '507' => InsufficientStorage,
  '508' => LoopDetected,
  '510' => NotExtended,
  '511' => NetworkAuthenticationRequired
}.freeze

Class Method Summary collapse

Class Method Details

.buildObject Also known as: new



10
11
12
# File 'lib/firebase_token_auth.rb', line 10

def build
  @client = ::FirebaseTokenAuth::Client.new(configuration)
end

.configurationObject



16
17
18
# File 'lib/firebase_token_auth.rb', line 16

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

.configure {|configuration(&block)| ... } ⇒ Object

Yields:



20
21
22
# File 'lib/firebase_token_auth.rb', line 20

def self.configure(&block)
  yield(configuration(&block))
end