Sha256: cfff4b206ba903f1c57b4f93bb204bece34d6852c1891c6846933c47c97ef043
Contents?: true
Size: 711 Bytes
Versions: 14
Compression:
Stored size: 711 Bytes
Contents
# encoding: utf-8 require 'sinatra' require 'json' require 'yaml' require 'erb' require 'aws-sdk' require 'openssl' require 'net/ssh' require 'peach' class GaptoolServer < Sinatra::Application disable :sessions enable :dump_errors error do {:result => 'error', :message => env['sinatra.error']}.to_json end before do if request.path_info != '/ping' error 401 unless $redis.hget('users', env['HTTP_X_GAPTOOL_USER']) == env['HTTP_X_GAPTOOL_KEY'] error 401 unless env['HTTP_X_GAPTOOL_USER'] && env['HTTP_X_GAPTOOL_KEY'] end end helpers do include Rack::Utils alias_method :h, :escape_html end end require_relative 'helpers/init' require_relative 'routes/init'
Version data entries
14 entries across 14 versions & 1 rubygems