PluginBaseClass
# File lib/openshift/runtime/frontend/http/plugins/haproxy-sni-proxy.rb, line 128 def add_alias(name) with_create do |d| d[@fqdn]["aliases"] << name end end
# File lib/openshift/runtime/frontend/http/plugins/haproxy-sni-proxy.rb, line 121 def aliases reader_if_exists do |d| return d[@fqdn]["aliases"].clone end nil end
# File lib/openshift/runtime/frontend/http/plugins/haproxy-sni-proxy.rb, line 60 def connect(*elements) reported_urls=[] with_create do |d| elements.each do |path, uri, options| next unless options["protocols"] and options["protocols"].include?("tls") if path.empty? reqport = @sni_ports[0] elsif path =~ /^TLS_PORT_(\d+)$/ idx = $~[1].to_i - 1 if idx >=0 reqport = @sni_ports[idx] end elsif @sni_ports.include?(path.to_i) reqport = path.to_i end if not reqport raise PluginException.new("Invalid port specified for SNI proxy \"#{path}\" (must either be \"\", or TLS_PORT_1, TLS_PORT_2, etc...)", @container_uuid, @fqdn) end if uri !~ /^\d+\.\d+\.\d+\.\d+\:\d+$/ raise PluginException.new("SNI proxy target must be IP:PORT", @container_uuid, @fqdn) end d[@fqdn]["connections"][reqport]=uri reported_urls << "tls:#{@fqdn}:#{reqport}" end end reported_urls end
# File lib/openshift/runtime/frontend/http/plugins/haproxy-sni-proxy.rb, line 95 def connections reader_if_exists do |d| return d[@fqdn]["connections"].select { |port, backend| backend.to_s != "" }.map { |port, backend| ["TLS_PORT_#{@sni_ports.index(port.to_i).to_i+1}", backend, { "protocols"=>["tls"] } ] } end [] end
# File lib/openshift/runtime/frontend/http/plugins/haproxy-sni-proxy.rb, line 43 def create with_create end
# File lib/openshift/runtime/frontend/http/plugins/haproxy-sni-proxy.rb, line 53 def destroy writer_if_exists do |d| d.delete(@fqdn) end end
# File lib/openshift/runtime/frontend/http/plugins/haproxy-sni-proxy.rb, line 106 def disconnect(*paths) writer_if_exists do |d| paths.each do |path| reqport = path if path=~/^TLS_PORT_(\d+)$/ idx = $~[1].to_i - 1 if idx >=0 reqport = @sni_ports[idx] end end d[@fqdn]["connections"].delete(reqport) end end end
Generated with the Darkfish Rdoc Generator 2.