class Puppet::Indirector::FileServer

Look files up using the file server.

Public Instance Methods

authorized?(request) click to toggle source

Is the client authorized to perform this action?

   # File lib/puppet/indirector/file_server.rb
11 def authorized?(request)
12   return false unless [:find, :search].include?(request.method)
13 
14   mount, _ = configuration.split_path(request)
15 
16   # If we're not serving this mount, then access is denied.
17   return false unless mount
18 
19   true
20 end
find(request) click to toggle source

Find our key using the fileserver.

   # File lib/puppet/indirector/file_server.rb
23 def find(request)
24   mount, relative_path = configuration.split_path(request)
25 
26   return nil unless mount
27 
28   # The mount checks to see if the file exists, and returns nil
29   # if not.
30   path = mount.find(relative_path, request)
31   return nil unless path
32   path2instance(request, path)
33 end

Private Instance Methods

configuration() click to toggle source

Our fileserver configuration, if needed.

   # File lib/puppet/indirector/file_server.rb
51 def configuration
52   Puppet::FileServing::Configuration.configuration
53 end