From dc2270491df7e1ac3f891f056e21dde6c7cf70e1 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Wed, 7 Jan 2015 12:39:17 +0200 Subject: [PATCH 1/9] Add basic REST API --- Gemfile | 5 +++++ Gemfile.lock | 21 +++++++++++++++++++++ app/api/repp/api.rb | 22 ++++++++++++++++++++++ config/application.rb | 3 +++ config/routes.rb | 2 ++ 5 files changed, 53 insertions(+) create mode 100644 app/api/repp/api.rb diff --git a/Gemfile b/Gemfile index 2bfb850fe..939553659 100644 --- a/Gemfile +++ b/Gemfile @@ -78,6 +78,11 @@ gem 'whenever', '~> 0.9.4', require: false # for dates and times gem 'iso8601', '~> 0.8.2' +# for REST API +gem 'grape', '~> 0.10.1' + +gem 'hashie_rails', '~> 0.0.1' + group :development, :test do # for inserting dummy data gem 'activerecord-import', '~> 0.6.0' diff --git a/Gemfile.lock b/Gemfile.lock index 0da446a29..75e4a0cde 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -125,6 +125,16 @@ GEM ruby_parser (~> 3.1, > 3.1.0) sexp_processor (~> 4.4) formatador (0.2.5) + grape (0.10.1) + activesupport + builder + hashie (>= 2.1.0) + multi_json (>= 1.3.2) + multi_xml (>= 0.5.2) + rack (>= 1.3.0) + rack-accept + rack-mount + virtus (>= 1.0.0) guard (2.6.1) formatador (>= 0.2.4) listen (~> 2.7) @@ -144,6 +154,10 @@ GEM activesupport (>= 4.0.1) haml (>= 3.1, < 5.0) railties (>= 4.0.1) + hashie (3.3.2) + hashie_rails (0.0.1) + hashie (>= 3.0) + rails (~> 4.0) highline (1.6.21) hike (1.2.3) hitimes (1.2.2) @@ -183,6 +197,7 @@ GEM mini_portile (0.6.0) minitest (5.5.0) multi_json (1.10.1) + multi_xml (0.5.5) nokogiri (1.6.2.1) mini_portile (= 0.6.0) nprogress-rails (0.1.3.1) @@ -212,6 +227,10 @@ GEM method_source (~> 0.8.1) slop (~> 3.4) rack (1.5.2) + rack-accept (0.4.5) + rack (>= 0.4) + rack-mount (0.8.3) + rack (>= 1.0.0) rack-test (0.6.2) rack (>= 1.0) railroady (1.2.0) @@ -391,10 +410,12 @@ DEPENDENCIES epp-xml (~> 0.10.3) fabrication (~> 2.11.3) faker (~> 1.3.0) + grape (~> 0.10.1) guard (~> 2.6.1) guard-rspec (~> 4.3.1) guard-rubocop (~> 1.1.0) haml-rails (~> 0.5.3) + hashie_rails (~> 0.0.1) isikukood iso8601 (~> 0.8.2) jbuilder (~> 2.0) diff --git a/app/api/repp/api.rb b/app/api/repp/api.rb new file mode 100644 index 000000000..5e837cdd9 --- /dev/null +++ b/app/api/repp/api.rb @@ -0,0 +1,22 @@ +module Repp + class API < Grape::API + format :json + prefix :repp + version 'v1', using: :path + + http_basic do |username, password| + @current_user ||= EppUser.find_by(username: username, password: password) + end + + helpers do + attr_reader :current_user + end + + resource :domains do + desc 'Return list of domains' + get '/' do + current_user.registrar.domains + end + end + end +end diff --git a/config/application.rb b/config/application.rb index 8e4a6a7c2..72702bcfe 100644 --- a/config/application.rb +++ b/config/application.rb @@ -27,6 +27,9 @@ module Registry # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de + config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb') + config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')] + config.generators do |g| g.stylesheets false g.javascripts false diff --git a/config/routes.rb b/config/routes.rb index 1c9ef495d..d2cec9962 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,6 +5,8 @@ Rails.application.routes.draw do get 'error/:command', to: 'errors#error', defaults: { format: :xml } end + mount Repp::API => '/' + ## ADMIN ROUTES namespace(:admin) do resources :keyrelays From 14187b76f1733fbd6ab3aed859f066aa56af8658 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Wed, 7 Jan 2015 15:48:48 +0200 Subject: [PATCH 2/9] Add total_pages --- app/api/repp/api.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/repp/api.rb b/app/api/repp/api.rb index 5e837cdd9..55d520bc4 100644 --- a/app/api/repp/api.rb +++ b/app/api/repp/api.rb @@ -15,7 +15,11 @@ module Repp resource :domains do desc 'Return list of domains' get '/' do - current_user.registrar.domains + domains = current_user.registrar.domains.page(params[:page]) + { + domains: domains, + total_pages: domains.total_pages + } end end end From 4af3e80087f5c4d6ebcc9f5aa238335586803411 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Wed, 7 Jan 2015 16:36:07 +0200 Subject: [PATCH 3/9] Refactor --- app/api/repp/api.rb | 12 +----------- app/api/repp/domain_v1.rb | 16 ++++++++++++++++ spec/requests/domain_spec.rb | 3 +++ 3 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 app/api/repp/domain_v1.rb create mode 100644 spec/requests/domain_spec.rb diff --git a/app/api/repp/api.rb b/app/api/repp/api.rb index 55d520bc4..9e6e1426f 100644 --- a/app/api/repp/api.rb +++ b/app/api/repp/api.rb @@ -2,7 +2,6 @@ module Repp class API < Grape::API format :json prefix :repp - version 'v1', using: :path http_basic do |username, password| @current_user ||= EppUser.find_by(username: username, password: password) @@ -12,15 +11,6 @@ module Repp attr_reader :current_user end - resource :domains do - desc 'Return list of domains' - get '/' do - domains = current_user.registrar.domains.page(params[:page]) - { - domains: domains, - total_pages: domains.total_pages - } - end - end + mount Repp::DomainV1 end end diff --git a/app/api/repp/domain_v1.rb b/app/api/repp/domain_v1.rb new file mode 100644 index 000000000..d4bd071e9 --- /dev/null +++ b/app/api/repp/domain_v1.rb @@ -0,0 +1,16 @@ +module Repp + class DomainV1 < Grape::API + version 'v1', using: :path + + resource :domains do + desc 'Return list of domains' + get '/' do + domains = current_user.registrar.domains.page(params[:page]) + { + domains: domains, + total_pages: domains.total_pages + } + end + end + end +end diff --git a/spec/requests/domain_spec.rb b/spec/requests/domain_spec.rb new file mode 100644 index 000000000..44afef5cf --- /dev/null +++ b/spec/requests/domain_spec.rb @@ -0,0 +1,3 @@ +describe Repp::API do + +end From c345448f652ead21661d418fb5c6ec8de7666fa7 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Wed, 7 Jan 2015 17:45:40 +0200 Subject: [PATCH 4/9] cleanup gemfile and added new version --- Gemfile | 112 +++++++++++++++++++------------------------------------- 1 file changed, 38 insertions(+), 74 deletions(-) diff --git a/Gemfile b/Gemfile index 939553659..1d443b928 100644 --- a/Gemfile +++ b/Gemfile @@ -1,87 +1,51 @@ source 'https://rubygems.org' -gem 'rails', '4.1.4' +# core +gem 'rails', '4.1.4' # '4.2.0' +gem 'iso8601', '~> 0.8.2' # for dates and times +gem 'hashie_rails', '~> 0.0.1' -# Use postgresql as the database for Active Record -gem 'pg' +# model related +gem 'pg', '~> 0.18.0' +gem 'ransack', '~> 1.3.0' # '1.5.1' # for searching +gem 'paper_trail', '~> 3.0.5' # '3.0.6' # archiving +gem 'rails-settings-cached', '~> 0.4.1' # for settings +gem 'delayed_job_active_record', '~> 4.0.2' # '4.0.3' # delayed job -# Use SCSS for stylesheets -gem 'sass-rails', '~> 4.0.3' +# html-xml +gem 'haml-rails', '~> 0.5.3' # '0.6.0' haml for views +gem 'nokogiri', '~> 1.6.2.1' # For XML parsing -# Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '>= 1.3.0' +# style +gem 'sass-rails', '~> 4.0.3' # '5.0.0' # sass style +gem 'bootstrap-sass', '~> 3.2.0.1' # '3.3.1.0' # bootstrap style -# Use CoffeeScript for .js.coffee assets and views -gem 'coffee-rails', '~> 4.0.0' +# js +gem 'uglifier', '>= 1.3.0' # '2.6.1' # minifies js +gem 'coffee-rails', '~> 4.0.0' # '4.1.0' # coffeescript support +gem 'turbolinks' # '2.5.3' # faster page load +gem 'jquery-rails' # '4.0.3' # jquery +gem 'jbuilder', '~> 2.0' # '2.2.6' # json api +gem 'selectize-rails', '~> 0.11.0' # '0.11.2' # include selectize.js for select -# Use jquery as the JavaScript library -gem 'jquery-rails' +# view helpers +gem 'kaminari', '~> 0.16.1' # pagination +gem 'nprogress-rails', '~> 0.1.3.1' # '0.1.6.5' # visual loader -# Turbolinks makes following links in your web application faster. -# Read more: https://github.com/rails/turbolinks -gem 'turbolinks' - -# Build JSON APIs with ease. -# Read more: https://github.com/rails/jbuilder -gem 'jbuilder', '~> 2.0' - -# Use ActiveModel has_secure_password -# gem 'bcrypt', '~> 3.1.7' - -# Replacement for erb -gem 'haml-rails', '~> 0.5.3' - -# For XML parsing -gem 'nokogiri', '~> 1.6.2.1' - -# For punycode -gem 'simpleidn', '~> 0.0.5' - -# for EE-id validation -gem 'isikukood' - -# for using bootstrap -gem 'bootstrap-sass', '~> 3.2.0.1' - -# for visual loader -gem 'nprogress-rails', '~> 0.1.3.1' - -# for pagination -gem 'kaminari', '~> 0.16.1' - -# for searching -gem 'ransack', '~> 1.3.0' - -# for rights -gem 'cancancan', '~> 1.9.2' - -# for login -gem 'devise', '~> 3.3.0' - -# for archiving -gem 'paper_trail', '~> 3.0.5' - -# for select -gem 'selectize-rails', '~> 0.11.0' - -# for settings -gem 'rails-settings-cached', '0.4.1' - -# delayed job -gem 'delayed_job_active_record', '~> 4.0.2' -# to process delayed jobs -gem 'daemons' - -# cron -gem 'whenever', '~> 0.9.4', require: false - -# for dates and times -gem 'iso8601', '~> 0.8.2' - -# for REST API +# rest api gem 'grape', '~> 0.10.1' -gem 'hashie_rails', '~> 0.0.1' +# rights +gem 'devise', '~> 3.3.0' # '3.4.0' # authenitcation +gem 'cancancan', '~> 1.9.2' # autharization + +# registry specfic +gem 'simpleidn', '~> 0.0.5' # For punycode +gem 'isikukood' # for EE-id validation + +# deploy +gem 'whenever', '~> 0.9.4', require: false +gem 'daemons' '~> 1.1.9' # process delayed jobs group :development, :test do # for inserting dummy data From 183ed51500972be36ca26643f132a6b1bfe3d764 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Wed, 7 Jan 2015 17:58:26 +0200 Subject: [PATCH 5/9] gemfile cleanup --- Gemfile | 135 ++++++++++++++++++++------------------------------------ 1 file changed, 49 insertions(+), 86 deletions(-) diff --git a/Gemfile b/Gemfile index 1d443b928..799b2773a 100644 --- a/Gemfile +++ b/Gemfile @@ -32,13 +32,13 @@ gem 'selectize-rails', '~> 0.11.0' # '0.11.2' # include selectize.js for select gem 'kaminari', '~> 0.16.1' # pagination gem 'nprogress-rails', '~> 0.1.3.1' # '0.1.6.5' # visual loader -# rest api -gem 'grape', '~> 0.10.1' - # rights gem 'devise', '~> 3.3.0' # '3.4.0' # authenitcation gem 'cancancan', '~> 1.9.2' # autharization +# rest api +gem 'grape', '~> 0.10.1' + # registry specfic gem 'simpleidn', '~> 0.0.5' # For punycode gem 'isikukood' # for EE-id validation @@ -47,95 +47,58 @@ gem 'isikukood' # for EE-id validation gem 'whenever', '~> 0.9.4', require: false gem 'daemons' '~> 1.1.9' # process delayed jobs -group :development, :test do - # for inserting dummy data - gem 'activerecord-import', '~> 0.6.0' - - gem 'capybara', '~> 2.4.1' - # For feature testing - # gem 'capybara-webkit', '1.2.0' # Webkit driver didn't work with turbolinks - gem 'phantomjs-binaries', '~> 1.9.2.4' - gem 'poltergeist', '~> 1.5.1' # We are using PhantomJS instead - gem 'phantomjs', '~> 1.9.7.1' - - # For cleaning db in feature and epp tests - gem 'database_cleaner', '~> 1.3.0' - - # EPP client - gem 'epp', '~> 1.4.0' - - # EPP XMLs - gem 'epp-xml', '~> 0.10.3' - - # Replacement for fixtures - gem 'fabrication', '~> 2.11.3' - - # Library to generate fake data - gem 'faker', '~> 1.3.0' - - # For debugging - gem 'pry', '~> 0.10.1' - # gem 'pry-byebug', '~> 1.3.3' - - # Testing framework - gem 'rspec-rails', '~> 3.0.2' - - # Additional matchers for RSpec - gem 'shoulda-matchers', '~> 2.6.1', require: false - - # For unique IDs (used by the epp gem) - gem 'uuidtools', '~> 2.1.4' - - # For code review - gem 'simplecov', '~> 0.9.1', require: false - gem 'rubycritic', '~> 1.1.1' - - # for finding database optimizations - gem 'bullet', '~> 4.14.0' - - # for finding future vulnerable gems - gem 'bundler-audit' - - # for security audit' - gem 'brakeman', '~> 2.6.2', require: false - - # bundle exec rake doc:rails generates the API under doc/api. - gem 'sdoc', '~> 0.4.0' - - # faster dev load time - gem 'unicorn' - - # for opening browser automatically - gem 'launchy', '~> 2.4.3' -end - group :development do - # Spring speeds up development by keeping your application running in the background. - # Read more: https://github.com/rails/spring - gem 'spring', '~> 1.2.0' + # dev tools + gem 'spring', '~> 1.2.0' gem 'spring-commands-rspec', '~> 1.0.2' - - # for fast deployment - gem 'mina', '~> 0.3.1' - - # for finding dead routes and unused actions - gem 'traceroute', '~> 0.4.0' - - # for improved errors - gem 'better_errors', '~> 2.0.0' - gem 'binding_of_caller', '~> 0.7.2' - - # run tests automatically - gem 'guard', '~> 2.6.1' - - # rspec support for guard + gem 'guard', '~> 2.6.1' # run tests automatically gem 'guard-rspec', '~> 4.3.1' gem 'rubocop', '~> 0.26.1' gem 'guard-rubocop', '~> 1.1.0' - # to generate database diagrams - gem 'railroady' + # improved errors + gem 'better_errors', '~> 2.0.0' + gem 'binding_of_caller', '~> 0.7.2' + gem 'traceroute', '~> 0.4.0' # for finding dead routes and unused actions - # See https://github.com/sstephenson/execjs#readme for more supported runtimes + # deploy + gem 'mina', '~> 0.3.1' # for fast deployment gem 'therubyracer', platforms: :ruby end + +group :development, :test do + # test stack + gem 'rspec-rails', '~> 3.0.2' + gem 'capybara', '~> 2.4.1' + gem 'phantomjs-binaries', '~> 1.9.2.4' + gem 'poltergeist', '~> 1.5.1' # We are using PhantomJS instead + gem 'phantomjs', '~> 1.9.7.1' + gem 'fabrication', '~> 2.11.3' # Replacement for fixtures + gem 'shoulda-matchers', '~> 2.6.1', require: false # Additional matchers for RSpec + gem 'launchy', '~> 2.4.3' # for opening browser automatically + + # helper gems + gem 'activerecord-import', '~> 0.6.0' # for inserting dummy data + gem 'database_cleaner', '~> 1.3.0' # For cleaning db in feature and epp tests + gem 'faker', '~> 1.3.0' # Library to generate fake data + + # EPP + gem 'epp', '~> 1.4.0' # EPP client + gem 'epp-xml', '~> 0.10.3' # EPP XMLs + gem 'uuidtools', '~> 2.1.4' # For unique IDs (used by the epp gem) + + # debug + gem 'pry', '~> 0.10.1' + + # code review + gem 'simplecov', '~> 0.9.1', require: false + gem 'rubycritic', '~> 1.1.1' + gem 'bullet', '~> 4.14.0' # for finding database optimizations + gem 'bundler-audit', '~> 0.3.1' # for finding future vulnerable gems + gem 'brakeman', '~> 2.6.2', require: false # for security audit' + gem 'sdoc', '~> 0.4.0' # bundle exec rake doc:rails generates the API under doc/api. + gem 'railroady' '~> 1.3.0' # to generate database diagrams + + # dev tools + gem 'unicorn' +end From 6de072b84989998f03d58a08116375c15d7a541a Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Wed, 7 Jan 2015 18:08:02 +0200 Subject: [PATCH 6/9] Add first test for REPP --- spec/requests/domain_spec.rb | 3 --- spec/requests/domain_v1_spec.rb | 22 ++++++++++++++++++++ spec/support/request.rb | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 3 deletions(-) delete mode 100644 spec/requests/domain_spec.rb create mode 100644 spec/requests/domain_v1_spec.rb create mode 100644 spec/support/request.rb diff --git a/spec/requests/domain_spec.rb b/spec/requests/domain_spec.rb deleted file mode 100644 index 44afef5cf..000000000 --- a/spec/requests/domain_spec.rb +++ /dev/null @@ -1,3 +0,0 @@ -describe Repp::API do - -end diff --git a/spec/requests/domain_v1_spec.rb b/spec/requests/domain_v1_spec.rb new file mode 100644 index 000000000..898132823 --- /dev/null +++ b/spec/requests/domain_v1_spec.rb @@ -0,0 +1,22 @@ +require 'rails_helper' + +describe Repp::DomainV1 do + let(:epp_user) { Fabricate(:epp_user) } + + before(:each) { create_settings } + + describe 'GET /repp/v1/domains' do + it 'returns domains of the current registrar' do + Fabricate.times(2, :domain, registrar: epp_user.registrar) + + get_with_auth '/repp/v1/domains', {}, epp_user + expect(response.status).to eq(200) + + body = JSON.parse(response.body) + expect(body['total_pages']).to eq(1) + + # TODO: Maybe there is a way not to convert from and to json again + expect(body['domains'].to_json).to eq(epp_user.registrar.domains.to_json) + end + end +end diff --git a/spec/support/request.rb b/spec/support/request.rb new file mode 100644 index 000000000..053874f0b --- /dev/null +++ b/spec/support/request.rb @@ -0,0 +1,36 @@ +module Request + def get_with_auth(path, params, epp_user) + get path, params, env_with_auth(epp_user) + end + + def delete_with_auth(path, epp_user) + delete path, params, env_with_auth(epp_user) + end + + def post_with_auth(path, params, epp_user) + post path, params, env_with_auth(epp_user) + end + + def patch_with_auth(path, params, epp_user) + patch path, params, env_with_auth(epp_user) + end + + def env + { + 'Accept' => 'application/json', + 'Content-Type' => 'application/json' + } + end + + def env_with_auth(epp_user) + env.merge({ + 'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Basic.encode_credentials( + epp_user.username, epp_user.password + ) + }) + end +end + +RSpec.configure do |c| + c.include Request, type: :request +end From 34a43af572610989cc91afb84f5a4fe2ca9acc6b Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Wed, 7 Jan 2015 18:17:46 +0200 Subject: [PATCH 7/9] gemfile cleanup --- Gemfile | 16 ++++++++-------- Gemfile.lock | 26 +++++++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Gemfile b/Gemfile index 799b2773a..f5db9a0e4 100644 --- a/Gemfile +++ b/Gemfile @@ -21,11 +21,10 @@ gem 'sass-rails', '~> 4.0.3' # '5.0.0' # sass style gem 'bootstrap-sass', '~> 3.2.0.1' # '3.3.1.0' # bootstrap style # js -gem 'uglifier', '>= 1.3.0' # '2.6.1' # minifies js -gem 'coffee-rails', '~> 4.0.0' # '4.1.0' # coffeescript support -gem 'turbolinks' # '2.5.3' # faster page load -gem 'jquery-rails' # '4.0.3' # jquery -gem 'jbuilder', '~> 2.0' # '2.2.6' # json api +gem 'uglifier', '>= 1.3.0' # '2.6.1' # minifies js +gem 'coffee-rails', '~> 4.0.0' # '4.1.0' # coffeescript support +gem 'turbolinks', '~> 2.5.3' # faster page load +gem 'jquery-rails', '~> 3.1.1' # '4.0.3' jquery gem 'selectize-rails', '~> 0.11.0' # '0.11.2' # include selectize.js for select # view helpers @@ -37,7 +36,8 @@ gem 'devise', '~> 3.3.0' # '3.4.0' # authenitcation gem 'cancancan', '~> 1.9.2' # autharization # rest api -gem 'grape', '~> 0.10.1' +gem 'grape', '~> 0.10.1' +gem 'jbuilder', '~> 2.2.6' # json api # registry specfic gem 'simpleidn', '~> 0.0.5' # For punycode @@ -45,7 +45,7 @@ gem 'isikukood' # for EE-id validation # deploy gem 'whenever', '~> 0.9.4', require: false -gem 'daemons' '~> 1.1.9' # process delayed jobs +gem 'daemons', '~> 1.1.9' # process delayed jobs group :development do # dev tools @@ -97,7 +97,7 @@ group :development, :test do gem 'bundler-audit', '~> 0.3.1' # for finding future vulnerable gems gem 'brakeman', '~> 2.6.2', require: false # for security audit' gem 'sdoc', '~> 0.4.0' # bundle exec rake doc:rails generates the API under doc/api. - gem 'railroady' '~> 1.3.0' # to generate database diagrams + gem 'railroady', '~> 1.3.0' # to generate database diagrams # dev tools gem 'unicorn' diff --git a/Gemfile.lock b/Gemfile.lock index 75e4a0cde..4fe5d8289 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -166,7 +166,7 @@ GEM ice_nine (0.11.0) isikukood (0.1.2) iso8601 (0.8.2) - jbuilder (2.2.2) + jbuilder (2.2.6) activesupport (>= 3.0.0, < 5) multi_json (~> 1.2) jquery-rails (3.1.2) @@ -209,7 +209,7 @@ GEM parser (2.2.0.pre.5) ast (>= 1.1, < 3.0) slop (~> 3.4, >= 3.4.5) - pg (0.17.1) + pg (0.18.1) phantomjs (1.9.7.1) phantomjs-binaries (1.9.2.4) sys-uname (= 0.9.0) @@ -233,7 +233,7 @@ GEM rack (>= 1.0.0) rack-test (0.6.2) rack (>= 1.0) - railroady (1.2.0) + railroady (1.3.0) rails (4.1.4) actionmailer (= 4.1.4) actionpack (= 4.1.4) @@ -253,7 +253,7 @@ GEM thor (>= 0.18.1, < 2.0) rainbow (2.0.0) raindrops (0.13.0) - rake (10.3.2) + rake (10.4.2) ransack (1.3.0) actionpack (>= 3.0) activerecord (>= 3.0) @@ -362,7 +362,7 @@ GEM treetop (1.4.15) polyglot polyglot (>= 0.3.1) - turbolinks (2.4.0) + turbolinks (2.5.3) coffee-rails tzinfo (1.2.2) thread_safe (~> 0.1) @@ -398,11 +398,11 @@ DEPENDENCIES bootstrap-sass (~> 3.2.0.1) brakeman (~> 2.6.2) bullet (~> 4.14.0) - bundler-audit + bundler-audit (~> 0.3.1) cancancan (~> 1.9.2) capybara (~> 2.4.1) coffee-rails (~> 4.0.0) - daemons + daemons (~> 1.1.9) database_cleaner (~> 1.3.0) delayed_job_active_record (~> 4.0.2) devise (~> 3.3.0) @@ -418,22 +418,22 @@ DEPENDENCIES hashie_rails (~> 0.0.1) isikukood iso8601 (~> 0.8.2) - jbuilder (~> 2.0) - jquery-rails + jbuilder (~> 2.2.6) + jquery-rails (~> 3.1.1) kaminari (~> 0.16.1) launchy (~> 2.4.3) mina (~> 0.3.1) nokogiri (~> 1.6.2.1) nprogress-rails (~> 0.1.3.1) paper_trail (~> 3.0.5) - pg + pg (~> 0.18.0) phantomjs (~> 1.9.7.1) phantomjs-binaries (~> 1.9.2.4) poltergeist (~> 1.5.1) pry (~> 0.10.1) - railroady + railroady (~> 1.3.0) rails (= 4.1.4) - rails-settings-cached (= 0.4.1) + rails-settings-cached (~> 0.4.1) ransack (~> 1.3.0) rspec-rails (~> 3.0.2) rubocop (~> 0.26.1) @@ -448,7 +448,7 @@ DEPENDENCIES spring-commands-rspec (~> 1.0.2) therubyracer traceroute (~> 0.4.0) - turbolinks + turbolinks (~> 2.5.3) uglifier (>= 1.3.0) unicorn uuidtools (~> 2.1.4) From fa58c33bb23a6733fdeb3099372059118367457e Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Thu, 8 Jan 2015 11:10:53 +0200 Subject: [PATCH 8/9] moved rubyracer back, otherwise deploy fails --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index f5db9a0e4..bed9be525 100644 --- a/Gemfile +++ b/Gemfile @@ -26,6 +26,7 @@ gem 'coffee-rails', '~> 4.0.0' # '4.1.0' # coffeescript support gem 'turbolinks', '~> 2.5.3' # faster page load gem 'jquery-rails', '~> 3.1.1' # '4.0.3' jquery gem 'selectize-rails', '~> 0.11.0' # '0.11.2' # include selectize.js for select +gem 'therubyracer', platforms: :ruby # view helpers gem 'kaminari', '~> 0.16.1' # pagination @@ -63,7 +64,6 @@ group :development do # deploy gem 'mina', '~> 0.3.1' # for fast deployment - gem 'therubyracer', platforms: :ruby end group :development, :test do From 080d1b718aedf3b01c5af70dad5a138ad67e16e9 Mon Sep 17 00:00:00 2001 From: Martin Lensment Date: Thu, 8 Jan 2015 11:13:18 +0200 Subject: [PATCH 9/9] Blank domain name fix --- app/helpers/epp/domains_helper.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helpers/epp/domains_helper.rb b/app/helpers/epp/domains_helper.rb index 0f3e8e326..3793d85d7 100644 --- a/app/helpers/epp/domains_helper.rb +++ b/app/helpers/epp/domains_helper.rb @@ -13,8 +13,8 @@ module Epp::DomainsHelper end def check_domain - ph = params_hash['epp']['command']['check']['check'] - @domains = Epp::EppDomain.check_availability(ph[:name]) + names = parsed_frame.css('name').map(&:text) + @domains = Epp::EppDomain.check_availability(names) render '/epp/domains/check' end @@ -119,6 +119,12 @@ module Epp::DomainsHelper private + ## CHECK + + def validate_domain_check_request + epp_request_valid?('name') + end + ## CREATE def validate_domain_create_request ret = true