Sha256: 602ee70bc17c501ac5e168d522c146a29e6ec9fc543ea4bbda655a8cc3c54988
Contents?: true
Size: 635 Bytes
Versions: 12
Compression:
Stored size: 635 Bytes
Contents
require 'certmeister/policy/response' module Certmeister module Policy class Existing def initialize(store) is_a_store?(store) or raise ArgumentError.new("expected a fetchable store but received a #{store.class}") @store = store end def authenticate(request) if @store.fetch(request[:cn]).nil? Certmeister::Policy::Response.new(true, nil) else Certmeister::Policy::Response.new(false, "certificate for cn already exists") end end private def is_a_store?(store) store.respond_to?(:fetch) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems