Class: RightScale::CachedCertificateStoreProxy
- Defined in:
- lib/right_agent/security/cached_certificate_store_proxy.rb
Overview
Proxy to actual certificate store which caches results in an LRU cache
Instance Method Summary collapse
-
#get_recipients(obj) ⇒ Object
Retrieve recipient certificates Results are not cached.
-
#get_signer(id) ⇒ Object
Check cache for signer certificate.
-
#initialize(store) ⇒ CachedCertificateStoreProxy
constructor
Initialize cache proxy with given certificate store.
Constructor Details
#initialize(store) ⇒ CachedCertificateStoreProxy
Initialize cache proxy with given certificate store
Parameters
- store(Object)
-
Certificate store responding to get_recipients and
get_signer
33 34 35 36 |
# File 'lib/right_agent/security/cached_certificate_store_proxy.rb', line 33 def initialize(store) @signer_cache = CertificateCache.new @store = store end |
Instance Method Details
#get_recipients(obj) ⇒ Object
Retrieve recipient certificates Results are not cached
Parameters
- packet(RightScale::Packet)
-
Packet containing recipient identity, ignored
Return
- (Array)
-
Recipient certificates
46 47 48 |
# File 'lib/right_agent/security/cached_certificate_store_proxy.rb', line 46 def get_recipients(obj) @store.get_recipients(obj) end |
#get_signer(id) ⇒ Object
Check cache for signer certificate
Parameters
- id(String)
-
Serialized identity of signer
Return
- (Array)
-
Signer certificates
57 58 59 |
# File 'lib/right_agent/security/cached_certificate_store_proxy.rb', line 57 def get_signer(id) @signer_cache.get(id) { @store.get_signer(id) } end |