Class: Nanite::CachedCertificateStoreProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/nanite/security/cached_certificate_store_proxy.rb

Overview

Proxy to actual certificate store which caches results in an LRU cache.

Instance Method Summary collapse

Constructor Details

#initialize(store) ⇒ CachedCertificateStoreProxy

Initialize cache proxy with given certificate store.



8
9
10
11
# File 'lib/nanite/security/cached_certificate_store_proxy.rb', line 8

def initialize(store)
  @signer_cache = CertificateCache.new
  @store = store
end

Instance Method Details

#get_recipients(obj) ⇒ Object

Results from ‘get_recipients’ are not cached



14
15
16
# File 'lib/nanite/security/cached_certificate_store_proxy.rb', line 14

def get_recipients(obj)
  @store.get_recipients(obj)
end

#get_signer(id) ⇒ Object

Check cache for signer certificate



19
20
21
# File 'lib/nanite/security/cached_certificate_store_proxy.rb', line 19

def get_signer(id)
  @signer_cache.get(id) { @store.get_signer(id) }
end