Project

General

Profile

« Previous | Next » 

Revision 23b2305f

Added by Marc Dequènes over 14 years ago

  • ID 23b2305f877821ffeda0c7457aa90e70b2d06f5b

[fix/security] Cyborg server interface: restrict non-leaf path lookup to containers

View differences:

bin/mapmaker
include CyborgServerInterface
include CyborgServerRootInterfaceAddon
class Taiste
include CyborgServerInterface
def api_methods
["coucou", "toto", "plop"]
end
dynamic_interface {|node_name| ">>> #{node_name} <<<" }
end
class DNS < Services::DNS::System
include CyborgServerInterface
......
"coucou: " + data.inspect
end
class Taiste
include CyborgServerInterface
def api_methods
["coucou", "toto", "plop"]
end
dynamic_interface {|node_name| ">>> #{node_name} <<<" }
end
class Zones
include CyborgServerStatefulInterface
......
@dns.zones
end
def api_container_methods
api_methods
end
stateful_dynamic_interface("dns/zones/#NODE#") {|node_name| Zone.new(node_name) }
class Zone < Services::DNS::Zone
lib/cyborghood/cyborg/interface.rb
methods & self.methods
end
def api_container_methods
[]
end
def api_containers
(api_klasses.keys + api_container_methods).sort
end
def api_leafs
(api_methods - api_container_methods).sort
end
def api_nodes
(api_klasses.keys + api_methods).sort
end
......
end
end
end
# not a container, leaving
return unless self.api_container_methods.include? next_node_name
next_node = child_node(next_node_name, session)
else
# unknown method

Also available in: Unified diff