Class: InstAccess::Config
- Inherits:
-
Object
- Object
- InstAccess::Config
- Defined in:
- lib/inst_access/config.rb
Instance Attribute Summary collapse
-
#issuers ⇒ Object
readonly
Returns the value of attribute issuers.
-
#service_jwks ⇒ Object
readonly
Returns the value of attribute service_jwks.
-
#signing_key ⇒ Object
readonly
Returns the value of attribute signing_key.
Instance Method Summary collapse
- #encryption_key ⇒ Object
-
#initialize(raw_signing_key, raw_encryption_key = nil, issuers: nil, service_jwks: []) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(raw_signing_key, raw_encryption_key = nil, issuers: nil, service_jwks: []) ⇒ Config
Returns a new instance of Config.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/inst_access/config.rb', line 27 def initialize(raw_signing_key, raw_encryption_key = nil, issuers: nil, service_jwks: []) @signing_key = OpenSSL::PKey::RSA.new(raw_signing_key) if raw_encryption_key @encryption_key = OpenSSL::PKey::RSA.new(raw_encryption_key) raise ArgumentError, 'the encryption key should be a public RSA key' if @encryption_key.private? end @issuers = issuers @service_jwks = service_jwks rescue OpenSSL::PKey::RSAError => e raise ArgumentError, e end |
Instance Attribute Details
#issuers ⇒ Object (readonly)
Returns the value of attribute issuers.
25 26 27 |
# File 'lib/inst_access/config.rb', line 25 def issuers @issuers end |
#service_jwks ⇒ Object (readonly)
Returns the value of attribute service_jwks.
25 26 27 |
# File 'lib/inst_access/config.rb', line 25 def service_jwks @service_jwks end |
#signing_key ⇒ Object (readonly)
Returns the value of attribute signing_key.
25 26 27 |
# File 'lib/inst_access/config.rb', line 25 def signing_key @signing_key end |
Instance Method Details
#encryption_key ⇒ Object
39 40 41 |
# File 'lib/inst_access/config.rb', line 39 def encryption_key @encryption_key || raise(ConfigError, 'Encryption key is not configured') end |