summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/rest_authorization.rb
blob: d9a837050c63c0102628860028a528725f87f634 (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(request)
            authconfig.allowed?(request)
        end
    end
end