Module: JwtRest::Secrets

Defined in:
lib/jwt_rest/secrets.rb

Class Method Summary collapse

Class Method Details

.rsa_privateObject



11
12
13
14
15
16
17
18
19
# File 'lib/jwt_rest/secrets.rb', line 11

def self.rsa_private
  pkey = rsa_private_key
  begin
    decoded = Base64.decode64(pkey)
    OpenSSL::PKey::RSA.new(decoded)
  rescue
    raise "Unable to decode your private key. Be sure to provide a valid RSA private key and then apply the Base64 encoding"
  end
end

.rsa_private_keyObject



3
4
5
# File 'lib/jwt_rest/secrets.rb', line 3

def self.rsa_private_key
  raise "You should override this method and provide the Base64 encoded of your RSA private key"
end

.valid_api_key?(api_key) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/jwt_rest/secrets.rb', line 7

def self.valid_api_key?(api_key)
  raise "You should override this method and provide a way to verify your API_KEYs"
end