Sha256: 0750b5c460ef6933ddd68ed859cccccfd77620c32bc676de3e1d27673b28eae1

Contents?: true

Size: 999 Bytes

Versions: 14

Compression:

Stored size: 999 Bytes

Contents

require 'puppet/network/client_request'
require 'puppet/network/authconfig'
require 'puppet/network/auth_config_parser'

module Puppet::Network
  class AuthConfigLoader
    # Create our config object if necessary. If there's no configuration file
    # we install our defaults
    def self.authconfig
      @auth_config_file ||= Puppet::Util::WatchedFile.new(Puppet[:rest_authconfig])
      if (not @auth_config) or @auth_config_file.changed?
        begin
          @auth_config = Puppet::Network::AuthConfigParser.new_from_file(Puppet[:rest_authconfig]).parse
        rescue Errno::ENOENT, Errno::ENOTDIR
          @auth_config = Puppet::Network::AuthConfig.new
        end
      end

      @auth_config
    end
  end

  module Authorization
    def authconfig
      AuthConfigLoader.authconfig
    end

    # Verify that our client has access.
    def check_authorization(indirection, method, key, params)
      authconfig.check_authorization(indirection, method, key, params)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
puppet-3.4.3 lib/puppet/network/authorization.rb
puppet-3.4.2 lib/puppet/network/authorization.rb
puppet-3.4.1 lib/puppet/network/authorization.rb
puppet-3.4.0 lib/puppet/network/authorization.rb
puppet-3.4.0.rc2 lib/puppet/network/authorization.rb
puppet-3.4.0.rc1 lib/puppet/network/authorization.rb
puppet-3.3.2 lib/puppet/network/authorization.rb
puppet-3.3.1 lib/puppet/network/authorization.rb
puppet-3.3.1.rc3 lib/puppet/network/authorization.rb
puppet-3.3.1.rc2 lib/puppet/network/authorization.rb
puppet-3.3.1.rc1 lib/puppet/network/authorization.rb
puppet-3.3.0 lib/puppet/network/authorization.rb
puppet-3.3.0.rc3 lib/puppet/network/authorization.rb
puppet-3.3.0.rc2 lib/puppet/network/authorization.rb