Class: FirebaseIdToken::Testing::Certificates
- Inherits:
-
Object
- Object
- FirebaseIdToken::Testing::Certificates
- Defined in:
- lib/firebase_id_token/testing/certificates.rb
Overview
When executing the test, manage secret key and certificate with Fixture. Valid for Ruby applications using minitest
Access Certificates.
FirebaseIdToken.test!
is required to start using this class.
When implementing minitest, always return the same certificate.
Provide secret key for encoding JWT.
List of available methods
Class Method Summary collapse
-
.certificate ⇒ string
Return the certificate defined by Fixture.
-
.find(kid, raise_error: false) ⇒ nil, OpenSSL::X509::Certificate
.find
is stubbed to always return the same certificate. -
.private_key ⇒ string
Return the secret key defined by Fixture.
Class Method Details
.certificate ⇒ string
Return the certificate defined by Fixture.
66 67 68 |
# File 'lib/firebase_id_token/testing/certificates.rb', line 66 def self.certificate @certs ||= jwt_json['certificate'] end |
.find(kid, raise_error: false) ⇒ nil, OpenSSL::X509::Certificate
.find
is stubbed to always return the same certificate.
18 19 20 21 |
# File 'lib/firebase_id_token/testing/certificates.rb', line 18 def self.find(kid, raise_error: false) cert = certificate OpenSSL::X509::Certificate.new cert end |
.private_key ⇒ string
Return the secret key defined by Fixture.
42 43 44 |
# File 'lib/firebase_id_token/testing/certificates.rb', line 42 def self.private_key @rsa_private ||= jwt_json['private_key'] end |