summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-10 12:45:21 +0200
committerAzul <azul@leap.se>2014-04-10 12:54:36 +0200
commitc1486cb9688d53c5ae266ff22ab279ead12eaa36 (patch)
tree18244bfab76e0786d16b8c97d4fb17358d95e57e
parent20197129459d90642c50c27e601ef13ece4a873b (diff)
move certs into toplevel
cleaned up all the engine stuff that was never really used. Afterwards there is not that much left that makes it into the toplevel.
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock7
-rw-r--r--app/controllers/v1/certs_controller.rb (renamed from certs/app/controllers/certs_controller.rb)2
-rw-r--r--app/models/client_certificate.rb (renamed from certs/app/models/client_certificate.rb)0
-rw-r--r--certs/Gemfile14
-rw-r--r--certs/Rakefile44
-rw-r--r--certs/Readme.md9
-rw-r--r--certs/app/assets/images/leap_web_certs/.gitkeep0
-rw-r--r--certs/app/assets/javascripts/leap_web_certs/.gitkeep0
-rw-r--r--certs/app/assets/stylesheets/leap_web_certs/.gitkeep0
-rw-r--r--certs/app/controllers/.gitkeep0
-rw-r--r--certs/app/helpers/.gitkeep0
-rw-r--r--certs/app/helpers/certs_helper.rb2
-rw-r--r--certs/app/mailers/.gitkeep0
-rw-r--r--certs/app/models/.gitkeep0
-rw-r--r--certs/app/views/.gitkeep0
-rw-r--r--certs/config/locales/en.yml2
-rw-r--r--certs/config/routes.rb5
-rw-r--r--certs/leap_web_certs.gemspec20
-rw-r--r--certs/lib/leap_web_certs.rb4
-rw-r--r--certs/lib/leap_web_certs/engine.rb5
-rw-r--r--certs/lib/tasks/leap_web_certs_tasks.rake4
-rwxr-xr-xcerts/script/rails8
-rw-r--r--certs/test/integration/navigation_test.rb9
-rw-r--r--certs/test/leap_web_certs_test.rb7
-rw-r--r--certs/test/test_helper.rb10
-rw-r--r--config/defaults.yml4
-rw-r--r--config/routes.rb1
-rw-r--r--leap_web.gemspec3
-rw-r--r--test/files/ca.crt (renamed from certs/test/files/ca.crt)0
-rw-r--r--test/files/ca.key (renamed from certs/test/files/ca.key)0
-rw-r--r--test/functional/v1/certs_controller_test.rb (renamed from certs/test/functional/certs_controller_test.rb)2
-rw-r--r--test/unit/client_certificate_test.rb (renamed from certs/test/unit/client_certificate_test.rb)0
33 files changed, 5 insertions, 158 deletions
diff --git a/Gemfile b/Gemfile
index b19d119..50c4b00 100644
--- a/Gemfile
+++ b/Gemfile
@@ -10,7 +10,6 @@ gem "json"
gem "ruby-srp", "~> 0.2.1"
gem "rails_warden"
-gem 'leap_web_certs', :path => 'certs'
gem 'leap_web_help', :path => 'help'
gem 'leap_web_billing', :path => 'billing'
diff --git a/Gemfile.lock b/Gemfile.lock
index 0967bd6..537dafd 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -12,12 +12,6 @@ PATH
braintree
PATH
- remote: certs
- specs:
- leap_web_certs (0.5.0)
- certificate_authority (>= 0.2.0)
-
-PATH
remote: help
specs:
leap_web_help (0.5.0)
@@ -265,7 +259,6 @@ DEPENDENCIES
kaminari (= 0.13.0)
launchy
leap_web_billing!
- leap_web_certs!
leap_web_help!
minitest-stub-const
mocha (~> 0.13.0)
diff --git a/certs/app/controllers/certs_controller.rb b/app/controllers/v1/certs_controller.rb
index 82cbc44..64cfa7f 100644
--- a/certs/app/controllers/certs_controller.rb
+++ b/app/controllers/v1/certs_controller.rb
@@ -1,4 +1,4 @@
-class CertsController < ApplicationController
+class V1::CertsController < ApplicationController
before_filter :require_login, :unless => :anonymous_certs_allowed?
diff --git a/certs/app/models/client_certificate.rb b/app/models/client_certificate.rb
index 76b07a2..76b07a2 100644
--- a/certs/app/models/client_certificate.rb
+++ b/app/models/client_certificate.rb
diff --git a/certs/Gemfile b/certs/Gemfile
deleted file mode 100644
index 992f236..0000000
--- a/certs/Gemfile
+++ /dev/null
@@ -1,14 +0,0 @@
-source "https://rubygems.org"
-
-eval(File.read(File.dirname(__FILE__) + '/../common_dependencies.rb'))
-
-# We require leap_web_core from here so we can use the path option.
-gem "leap_web_core", :path => '../core'
-
-# Declare your gem's dependencies in leap_web_users.gemspec.
-# Bundler will treat runtime dependencies like base dependencies, and
-# development dependencies will be added by default to the :development group.
-gemspec
-
-# To use debugger
-# gem 'ruby-debug'
diff --git a/certs/Rakefile b/certs/Rakefile
deleted file mode 100644
index 54ed86d..0000000
--- a/certs/Rakefile
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env rake
-
-require 'rake/packagetask'
-require 'rubygems/package_task'
-
-begin
- require 'bundler/setup'
-rescue LoadError
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
-end
-begin
- require 'rdoc/task'
-rescue LoadError
- require 'rdoc/rdoc'
- require 'rake/rdoctask'
- RDoc::Task = Rake::RDocTask
-end
-
-RDoc::Task.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'LeapWebCerts'
- rdoc.options << '--line-numbers'
- rdoc.rdoc_files.include('README.rdoc')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
-
-spec = eval(File.read('leap_web_certs.gemspec'))
-Gem::PackageTask.new(spec) do |p|
- p.gem_spec = spec
-end
-
-Bundler::GemHelper.install_tasks
-
-require 'rake/testtask'
-
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.libs << 'test'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = false
-end
-
-
-task :default => :test
diff --git a/certs/Readme.md b/certs/Readme.md
deleted file mode 100644
index 4ea8d9d..0000000
--- a/certs/Readme.md
+++ /dev/null
@@ -1,9 +0,0 @@
-LeapWebCerts
-=========
-
-
-Configuration
--------------
-
-
-Currently LeapWebCerts falls back to handing out a cert in /config/cert if the cert pool is empty. You need to add that file in the application that includes this engine.
diff --git a/certs/app/assets/images/leap_web_certs/.gitkeep b/certs/app/assets/images/leap_web_certs/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/assets/images/leap_web_certs/.gitkeep
+++ /dev/null
diff --git a/certs/app/assets/javascripts/leap_web_certs/.gitkeep b/certs/app/assets/javascripts/leap_web_certs/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/assets/javascripts/leap_web_certs/.gitkeep
+++ /dev/null
diff --git a/certs/app/assets/stylesheets/leap_web_certs/.gitkeep b/certs/app/assets/stylesheets/leap_web_certs/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/assets/stylesheets/leap_web_certs/.gitkeep
+++ /dev/null
diff --git a/certs/app/controllers/.gitkeep b/certs/app/controllers/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/controllers/.gitkeep
+++ /dev/null
diff --git a/certs/app/helpers/.gitkeep b/certs/app/helpers/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/helpers/.gitkeep
+++ /dev/null
diff --git a/certs/app/helpers/certs_helper.rb b/certs/app/helpers/certs_helper.rb
deleted file mode 100644
index 94e76b8..0000000
--- a/certs/app/helpers/certs_helper.rb
+++ /dev/null
@@ -1,2 +0,0 @@
-module CertsHelper
-end
diff --git a/certs/app/mailers/.gitkeep b/certs/app/mailers/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/mailers/.gitkeep
+++ /dev/null
diff --git a/certs/app/models/.gitkeep b/certs/app/models/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/models/.gitkeep
+++ /dev/null
diff --git a/certs/app/views/.gitkeep b/certs/app/views/.gitkeep
deleted file mode 100644
index e69de29..0000000
--- a/certs/app/views/.gitkeep
+++ /dev/null
diff --git a/certs/config/locales/en.yml b/certs/config/locales/en.yml
deleted file mode 100644
index 18e4f47..0000000
--- a/certs/config/locales/en.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-en:
- cert_pool_empty: "Sorry the Cert pool is empty, please check back later."
diff --git a/certs/config/routes.rb b/certs/config/routes.rb
deleted file mode 100644
index cb97757..0000000
--- a/certs/config/routes.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-Rails.application.routes.draw do
- scope '/1' do
- resource :cert, :only => [:show]
- end
-end
diff --git a/certs/leap_web_certs.gemspec b/certs/leap_web_certs.gemspec
deleted file mode 100644
index 87b5be4..0000000
--- a/certs/leap_web_certs.gemspec
+++ /dev/null
@@ -1,20 +0,0 @@
-$:.push File.expand_path("../lib", __FILE__)
-
-require File.expand_path('../../lib/leap_web/version.rb', __FILE__)
-
-# Describe your gem and declare its dependencies:
-Gem::Specification.new do |s|
- s.name = "leap_web_certs"
- s.version = LeapWeb::VERSION
- s.authors = ["Azul"]
- s.email = ["azul@leap.se"]
- s.homepage = "http://www.leap.se"
- s.summary = "Cert distribution for the leap platform"
- s.description = "This plugin for the leap platform distributes certs for the EIP client. It fetches the certs from a pool in CouchDB that is filled by leap-ca."
-
- s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "Readme.md"]
- s.test_files = Dir["test/**/*"]
-
- s.add_dependency "certificate_authority", [">= 0.2.0"]
-
-end
diff --git a/certs/lib/leap_web_certs.rb b/certs/lib/leap_web_certs.rb
deleted file mode 100644
index beb683d..0000000
--- a/certs/lib/leap_web_certs.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require "leap_web_certs/engine"
-
-module LeapWebCerts
-end
diff --git a/certs/lib/leap_web_certs/engine.rb b/certs/lib/leap_web_certs/engine.rb
deleted file mode 100644
index 33a446e..0000000
--- a/certs/lib/leap_web_certs/engine.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module LeapWebCerts
- class Engine < ::Rails::Engine
-
- end
-end
diff --git a/certs/lib/tasks/leap_web_certs_tasks.rake b/certs/lib/tasks/leap_web_certs_tasks.rake
deleted file mode 100644
index e8fb7ff..0000000
--- a/certs/lib/tasks/leap_web_certs_tasks.rake
+++ /dev/null
@@ -1,4 +0,0 @@
-# desc "Explaining what the task does"
-# task :leap_web_certs do
-# # Task goes here
-# end
diff --git a/certs/script/rails b/certs/script/rails
deleted file mode 100755
index 616d3c9..0000000
--- a/certs/script/rails
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby1.8
-# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
-
-ENGINE_ROOT = File.expand_path('../..', __FILE__)
-ENGINE_PATH = File.expand_path('../../lib/leap_web_certs/engine', __FILE__)
-
-require 'rails/all'
-require 'rails/engine/commands'
diff --git a/certs/test/integration/navigation_test.rb b/certs/test/integration/navigation_test.rb
deleted file mode 100644
index eec8c0e..0000000
--- a/certs/test/integration/navigation_test.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require 'test_helper'
-
-class NavigationTest < ActionDispatch::IntegrationTest
-
- # test "the truth" do
- # assert true
- # end
-end
-
diff --git a/certs/test/leap_web_certs_test.rb b/certs/test/leap_web_certs_test.rb
deleted file mode 100644
index ee2058b..0000000
--- a/certs/test/leap_web_certs_test.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-require 'test_helper'
-
-class LeapWebCertsTest < ActiveSupport::TestCase
- test "truth" do
- assert_kind_of Module, LeapWebCerts
- end
-end
diff --git a/certs/test/test_helper.rb b/certs/test/test_helper.rb
deleted file mode 100644
index f6b4eb8..0000000
--- a/certs/test/test_helper.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-ENV["RAILS_ENV"] = "test"
-require File.expand_path('../../../test/dummy/config/environment', __FILE__)
-require 'rails/test_help'
-require 'mocha/setup'
-
-Rails.backtrace_cleaner.remove_silencers!
-
-# Load support files
-Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
-
diff --git a/config/defaults.yml b/config/defaults.yml
index cb18795..e7d0f5e 100644
--- a/config/defaults.yml
+++ b/config/defaults.yml
@@ -1,6 +1,6 @@
dev_ca: &dev_ca
- client_ca_key: "./certs/test/files/ca.key"
- client_ca_cert: "./certs/test/files/ca.crt"
+ client_ca_key: "./test/files/ca.key"
+ client_ca_cert: "./test/files/ca.crt"
ca_key_password: nil
cert_options: &cert_options
diff --git a/config/routes.rb b/config/routes.rb
index 05eca9b..b930bd1 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -24,6 +24,7 @@ LeapWeb::Application.routes.draw do
delete "logout" => "sessions#destroy", :as => "logout"
resources :users, :only => [:create, :update, :destroy, :index]
resources :messages, :only => [:index, :update]
+ resource :cert, :only => [:show]
end
scope "(:locale)", :locale => MATCH_LOCALE do
diff --git a/leap_web.gemspec b/leap_web.gemspec
index 44a30e0..125c930 100644
--- a/leap_web.gemspec
+++ b/leap_web.gemspec
@@ -19,7 +19,4 @@ Gem::Specification.new do |s|
s.email = 'azul@leap.se'
s.homepage = 'http://leap.se'
- # s.add_dependency 'leap_web_core'
- s.add_dependency 'leap_web_certs', LeapWeb::VERSION
- s.add_dependency 'leap_web_users', LeapWeb::VERSION
end
diff --git a/certs/test/files/ca.crt b/test/files/ca.crt
index 8393eee..8393eee 100644
--- a/certs/test/files/ca.crt
+++ b/test/files/ca.crt
diff --git a/certs/test/files/ca.key b/test/files/ca.key
index 125997f..125997f 100644
--- a/certs/test/files/ca.key
+++ b/test/files/ca.key
diff --git a/certs/test/functional/certs_controller_test.rb b/test/functional/v1/certs_controller_test.rb
index 503e74b..2c70e52 100644
--- a/certs/test/functional/certs_controller_test.rb
+++ b/test/functional/v1/certs_controller_test.rb
@@ -1,6 +1,6 @@
require 'test_helper'
-class CertsControllerTest < ActionController::TestCase
+class V1::CertsControllerTest < ActionController::TestCase
test "send limited cert without login" do
with_config allow_limited_certs: true, allow_anonymous_certs: true do
diff --git a/certs/test/unit/client_certificate_test.rb b/test/unit/client_certificate_test.rb
index 036e724..036e724 100644
--- a/certs/test/unit/client_certificate_test.rb
+++ b/test/unit/client_certificate_test.rb