Class: SignIn::OpenidConnectCertificatesPresenter
- Inherits:
-
Object
- Object
- SignIn::OpenidConnectCertificatesPresenter
- Defined in:
- app/services/sign_in/openid_connect_certificates_presenter.rb
Instance Method Summary collapse
- #perform ⇒ Object
- #private_key(file_path: Settings.sign_in.jwt_encode_key) ⇒ Object private
- #public_keys ⇒ Object private
- #public_keys_jwk ⇒ Object private
Instance Method Details
#perform ⇒ Object
5 6 7 8 9 |
# File 'app/services/sign_in/openid_connect_certificates_presenter.rb', line 5 def perform { keys: public_keys_jwk } end |
#private_key(file_path: Settings.sign_in.jwt_encode_key) ⇒ Object (private)
26 27 28 |
# File 'app/services/sign_in/openid_connect_certificates_presenter.rb', line 26 def private_key(file_path: Settings.sign_in.jwt_encode_key) OpenSSL::PKey::RSA.new(File.read(file_path)) end |
#public_keys ⇒ Object (private)
19 20 21 22 23 24 |
# File 'app/services/sign_in/openid_connect_certificates_presenter.rb', line 19 def public_keys public_keys = [private_key.public_key] old_key_file_path = Settings.sign_in.jwt_old_encode_key public_keys.push private_key(file_path: old_key_file_path).public_key if old_key_file_path public_keys end |
#public_keys_jwk ⇒ Object (private)
13 14 15 16 17 |
# File 'app/services/sign_in/openid_connect_certificates_presenter.rb', line 13 def public_keys_jwk public_keys.map do |public_key| JWT::JWK.new(public_key, { alg: 'RS256', use: 'sig' }).export end end |