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
12 def authorized?(request)
13   return false unless [:find, :search].include?(request.method)
14 
15   mount, _ = configuration.split_path(request)
16 
17   # If we're not serving this mount, then access is denied.
18   return false unless mount
19 
20   true
21 end
find(request) click to toggle source

Find our key using the fileserver.

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

Private Instance Methods

configuration() click to toggle source

Our fileserver configuration, if needed.

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