Class: OCI::Auth::Signers::EphemeralRPSessionKeySupplier

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/auth/signers/ephemeral_resource_principals_signer.rb

Overview

EphemeralRPSessionKeySupplier for containing key info

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(private_key, private_key_passphrase) ⇒ EphemeralRPSessionKeySupplier

Returns a new instance of EphemeralRPSessionKeySupplier.



113
114
115
116
117
118
119
# File 'lib/oci/auth/signers/ephemeral_resource_principals_signer.rb', line 113

def initialize(private_key, private_key_passphrase)
  raise 'Missing Resource Principal Private Key' if private_key.nil?

  @private_key = private_key
  @private_key_passphrase = private_key_passphrase
  refresh
end

Instance Attribute Details

#session_keyObject

Returns the value of attribute session_key.



111
112
113
# File 'lib/oci/auth/signers/ephemeral_resource_principals_signer.rb', line 111

def session_key
  @session_key
end

Instance Method Details

#refreshObject



121
122
123
124
125
126
127
# File 'lib/oci/auth/signers/ephemeral_resource_principals_signer.rb', line 121

def refresh
  @session_key = if File.exist?(File.expand_path(@private_key))
                   OCI::Auth::Util.load_private_key_from_file(File.expand_path(@private_key), @private_key_passphrase)
                 else
                   OCI::Auth::Util.load_private_key(@private_key, @private_key_passphrase)
                 end
end