summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/rest_authorization.rb
blob: d636d486a158e4093e96203f2d25c0e6eba78297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'puppet/network/client_request'
require 'puppet/network/rest_authconfig'

module Puppet::Network

  module RestAuthorization


    # Create our config object if necessary. If there's no configuration file
    # we install our defaults
    def authconfig
      @authconfig ||= Puppet::Network::RestAuthConfig.main

      @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