Sha256: 9f93688dd7ff89fa5bc3890b2aff32ae1b7c6b674204ab109f268a8787bd2a36

Contents?: true

Size: 474 Bytes

Versions: 12

Compression:

Stored size: 474 Bytes

Contents

require 'certmeister/policy'

module Certmeister

  module Policy

    class ChainAny

      def initialize(policies)
        Certmeister::Policy.validate_policies(policies)
        @policies = policies
      end

      def authenticate(request)
        @policies.inject(nil) do |continue, policy|
          response = policy.authenticate(request)
          break response if response.authenticated?
          continue or response
        end
      end

    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
certmeister-2.3.2 lib/certmeister/policy/chain_any.rb
certmeister-2.3.1 lib/certmeister/policy/chain_any.rb
certmeister-2.3.0 lib/certmeister/policy/chain_any.rb
certmeister-2.2.0 lib/certmeister/policy/chain_any.rb
certmeister-2.1.0 lib/certmeister/policy/chain_any.rb
certmeister-2.0.0 lib/certmeister/policy/chain_any.rb
certmeister-1.2.1 lib/certmeister/policy/chain_any.rb
certmeister-1.2.0 lib/certmeister/policy/chain_any.rb
certmeister-1.1.0 lib/certmeister/policy/chain_any.rb
certmeister-1.0.1 lib/certmeister/policy/chain_any.rb
certmeister-1.0.0 lib/certmeister/policy/chain_any.rb
certmeister-0.4.1 lib/certmeister/policy/chain_any.rb