blob: 5dd4fb5e6fc825ca59a28828376075adafbaec71 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
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
unless defined? @authconfig
@authconfig = Puppet::Network::RestAuthConfig.main
end
@authconfig
end
# Verify that our client has access.
def check_authorization(request)
authconfig.allowed?(request)
end
end
end
|