Class: SMARTAppLaunch::JWKS
- Inherits:
-
Object
- Object
- SMARTAppLaunch::JWKS
- Defined in:
- lib/smart_app_launch/jwks.rb
Class Method Summary collapse
Class Method Details
.default_jwks_path ⇒ Object
13 14 15 |
# File 'lib/smart_app_launch/jwks.rb', line 13 def default_jwks_path @default_jwks_path ||= File.join(__dir__, 'smart_jwks.json') end |
.jwks ⇒ Object
22 23 24 |
# File 'lib/smart_app_launch/jwks.rb', line 22 def jwks @jwks ||= JWT::JWK::Set.new(JSON.parse(File.read(jwks_path))) end |
.jwks_json ⇒ Object
6 7 8 9 10 11 |
# File 'lib/smart_app_launch/jwks.rb', line 6 def jwks_json @jwks_json ||= JSON.pretty_generate( { keys: jwks.export[:keys].select { |key| key[:key_ops]&.include?('verify') } } ) end |
.jwks_path ⇒ Object
17 18 19 20 |
# File 'lib/smart_app_launch/jwks.rb', line 17 def jwks_path @jwks_path ||= ENV.fetch('SMART_JWKS_PATH', default_jwks_path) end |