Permalink
Browse files

first import

  • Loading branch information...
1 parent 34a9a13 commit 2ad93af9b0043c3579943190e0faa27ec2ff6c23 @mkristian committed Oct 29, 2010
Showing with 11,455 additions and 105 deletions.
  1. +2 −0 .gitignore
  2. +0 −43 README
  3. +21 −0 README.textile
  4. +4 −0 demo/.gitignore
  5. +34 −0 demo/Gemfile
  6. +194 −0 demo/Gemfile.pom-
  7. +256 −0 demo/README
  8. +7 −0 demo/Rakefile
  9. +3 −0 demo/app/controllers/application_controller.rb
  10. +86 −0 demo/app/controllers/users_controller.rb
  11. +2 −0 demo/app/helpers/application_helper.rb
  12. +2 −0 demo/app/helpers/users_helper.rb
  13. +2 −0 demo/app/models/user.rb
  14. +14 −0 demo/app/views/layouts/application.html.erb
  15. +21 −0 demo/app/views/users/_form.html.erb
  16. +6 −0 demo/app/views/users/edit.html.erb
  17. +23 −0 demo/app/views/users/index.html.erb
  18. +5 −0 demo/app/views/users/new.html.erb
  19. +10 −0 demo/app/views/users/show.html.erb
  20. +4 −0 demo/config.ru
  21. +42 −0 demo/config/application.rb
  22. +22 −0 demo/config/boot.rb
  23. +22 −0 demo/config/database.yml
  24. +5 −0 demo/config/environment.rb
  25. +28 −0 demo/config/environments/development.rb
  26. +49 −0 demo/config/environments/production.rb
  27. +35 −0 demo/config/environments/test.rb
  28. +7 −0 demo/config/initializers/backtrace_silencers.rb
  29. +10 −0 demo/config/initializers/inflections.rb
  30. +5 −0 demo/config/initializers/mime_types.rb
  31. +7 −0 demo/config/initializers/secret_token.rb
  32. +8 −0 demo/config/initializers/session_store.rb
  33. +5 −0 demo/config/locales/en.yml
  34. +60 −0 demo/config/routes.rb
  35. +13 −0 demo/db/migrate/20101028220337_create_users.rb
  36. +21 −0 demo/db/schema.rb
  37. +7 −0 demo/db/seeds.rb
  38. +2 −0 demo/doc/README_FOR_APP
  39. 0 demo/lib/tasks/.gitkeep
  40. +26 −0 demo/public/404.html
  41. +26 −0 demo/public/422.html
  42. +26 −0 demo/public/500.html
  43. 0 demo/public/favicon.ico
  44. BIN demo/public/images/rails.png
  45. +316 −0 demo/public/index.html
  46. +2 −0 demo/public/javascripts/application.js
  47. +965 −0 demo/public/javascripts/controls.js
  48. +974 −0 demo/public/javascripts/dragdrop.js
  49. +1,123 −0 demo/public/javascripts/effects.js
  50. +6,001 −0 demo/public/javascripts/prototype.js
  51. +175 −0 demo/public/javascripts/rails.js
  52. +5 −0 demo/public/robots.txt
  53. 0 demo/public/stylesheets/.gitkeep
  54. +56 −0 demo/public/stylesheets/scaffold.css
  55. +6 −0 demo/script/rails
  56. +15 −0 demo/src/main/jetty/override-development-web.xml
  57. +15 −0 demo/src/main/jetty/override-production-web.xml
  58. +37 −0 demo/src/main/webapp/WEB-INF/web.xml
  59. +316 −0 demo/src/main/webapp/index.html
  60. BIN demo/src/test-/resources/server.keystore
  61. BIN demo/src/test/resources/server.keystore
  62. +7 −0 demo/test/fixtures/users.yml
  63. +49 −0 demo/test/functional/users_controller_test.rb
  64. +9 −0 demo/test/performance/browsing_test.rb
  65. +13 −0 demo/test/test_helper.rb
  66. +4 −0 demo/test/unit/helpers/users_helper_test.rb
  67. +8 −0 demo/test/unit/user_test.rb
  68. 0 demo/vendor/plugins/.gitkeep
  69. +20 −0 enforce-ssl-gem/MIT-LICENSE
  70. +44 −0 enforce-ssl-gem/README.textile
  71. +47 −0 enforce-ssl-gem/Rakefile
  72. +32 −0 enforce-ssl-gem/enforce-ssl.gemspec
  73. +79 −0 enforce-ssl-gem/lib/enforce-ssl.rb
  74. 0 {test → enforce-ssl-gem/test-disabled}/ssl_requirement_test.rb
  75. +0 −62 lib/ssl_requirement.rb
  76. +15 −0 pom.xml
View
@@ -0,0 +1,2 @@
+target
+*.pom
View
@@ -1,43 +0,0 @@
-SSL Requirement
-===============
-
-SSL requirement adds a declarative way of specifying that certain actions
-should only be allowed to run under SSL, and if they're accessed without it,
-they should be redirected.
-
-Example:
-
- class ApplicationController < ActiveRecord::Base
- include SslRequirement
- end
-
- class AccountController < ApplicationController
- ssl_required :signup, :payment
- ssl_allowed :index
-
- def signup
- # Non-SSL access will be redirected to SSL
- end
-
- def payment
- # Non-SSL access will be redirected to SSL
- end
-
- def index
- # This action will work either with or without SSL
- end
-
- def other
- # SSL access will be redirected to non-SSL
- end
- end
-
-You can overwrite the protected method ssl_required? to rely on other things
-than just the declarative specification. Say, only premium accounts get SSL.
-
-P.S.: Beware when you include the SslRequirement module. At the time of
-inclusion, it'll add the before_filter that validates the declarations. Some
-times you'll want to run other before_filters before that. They should then be
-declared ahead of including this module.
-
-Copyright (c) 2005 David Heinemeier Hansson, released under the MIT license
View
@@ -0,0 +1,21 @@
+h1. Enforce SSL for you controllers
+
+p. this is derived from the http://github.org/rails/ssl_requirement:rails/ssl_requirement and adopted a more strict approach: security everything and open where needed.
+
+p. info about the actual gem please look into the directory http://github.org/mkristian/ixtlan-guard/gem:enforce-ssl-gem
+
+h2. demo rails application
+
+p. the http://github.org/mkristian/ixtlan-guard/gem:demo is a sample rails3 application with integration tests. see readme how to start the application and what limitations apply.
+
+h2. run all the tests + integrations-tests in one go
+
+p. first you need jruby for this ! then you need to install
+
+bc. jruby -S gem 'ruby-maven'
+
+p. which allows to run the integration-tests from the demo with jetty.
+
+p. now you can execute
+
+bc. rmvn verify
View
@@ -0,0 +1,4 @@
+.bundle
+db/*.sqlite3
+log/*.log
+tmp/**/*
View
@@ -0,0 +1,34 @@
+source 'http://rubygems.org'
+
+gem 'rails', '3.0.0'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3-ruby', :require => 'sqlite3' unless defined?(JRUBY_VERSION)
+gem "activerecord-jdbc-adapter" if defined?(JRUBY_VERSION)
+gem "jdbc-sqlite3", :require => false if defined?(JRUBY_VERSION)
+
+# Use unicorn as the web server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug'
+
+# Bundle the extra gems:
+# gem 'bj'
+# gem 'nokogiri'
+# gem 'sqlite3-ruby', :require => 'sqlite3'
+# gem 'aws-s3', :require => 'aws/s3'
+
+# Bundle gems for the local environment. Make sure to
+# put test-only gems in this group so their generators
+# and rake tasks are available in development mode:
+# group :development, :test do
+# gem 'webrat'
+# end
+
+gem 'enforce-ssl'
View
@@ -0,0 +1,194 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>rubygems</groupId>
+ <artifactId>demo</artifactId>
+ <version>0.0.0</version>
+ <name>demo - rails application</name>
+ <packaging>war</packaging>
+ <repositories>
+ <repository>
+ <id>rubygems-releases</id>
+ <url>http://gems.saumya.de/releases</url>
+ </repository>
+ <repository>
+ <id>saumya</id>
+ <url>http://mojo.saumya.de/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>sonatype-nexus-snapshots</id>
+ <url>http://oss.sonatype.org/content/repositories/snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>rails</artifactId>
+ <version>3.0.0</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>activerecord-jdbc-adapter</artifactId>
+ <version>[0.0.0,)</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>rubygems</groupId>
+ <artifactId>jdbc-sqlite3</artifactId>
+ <version>[0.0.0,)</version>
+ <type>gem</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jruby.rack</groupId>
+ <artifactId>jruby-rack</artifactId>
+ <version>1.0.4.dev-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jruby</groupId>
+ <artifactId>jruby-complete</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <gem.home>${project.build.directory}/rubygems</gem.home>
+ <gem.path>${project.build.directory}/rubygems</gem.path>
+ <jruby.plugins.version>0.23.0-SNAPSHOT</jruby.plugins.version>
+ <jetty.version>7.1.0.RC1</jetty.version>
+ <rails.env>development</rails.env>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>de.saumya.mojo</groupId>
+ <artifactId>rails3-maven-plugin</artifactId>
+ <version>0.23.0-SNAPSHOT</version>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>initialize</id>
+ <goals>
+ <goal>initialize</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>public</directory>
+ </resource>
+ <resource>
+ <directory>.</directory>
+ <targetPath>WEB-INF</targetPath>
+ <includes>
+ <include>app/**</include>
+ <include>config/**</include>
+ <include>lib/**</include>
+ <include>vendor/**</include>
+ <include>Gemfile</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>${gem.path}</directory>
+ <targetPath>WEB-INF/gems</targetPath>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>development</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <property>
+ <name>rails.env</name>
+ <value>development</value>
+ </property>
+ </activation>
+ </profile>
+ <profile>
+ <id>production</id>
+ <activation>
+ <property>
+ <name>rails.env</name>
+ <value>production</value>
+ </property>
+ </activation>
+ <properties>
+ <gem.home>${project.build.directory}/rubygems-production</gem.home>
+ <gem.path>${project.build.directory}/rubygems-production</gem.path>
+ </properties>
+ </profile>
+ <profile>
+ <id>test</id>
+ <activation>
+ <property>
+ <name>rails.env</name>
+ <value>test</value>
+ </property>
+ </activation>
+ </profile>
+ <profile>
+ <id>war</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>${jetty.version}</version>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>run</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>${jetty.version}</version>
+ <configuration>
+ <webAppConfig>
+ <overrideDescriptor>src/main/jetty/override-${rails.env}-web.xml</overrideDescriptor>
+ </webAppConfig>
+ <connectors>
+ <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+ <port>8080</port>
+ </connector>
+ <connector implementation="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
+ <port>8443</port>
+ <keystore>src/test/resources/server.keystore</keystore>
+ <keyPassword>123456</keyPassword>
+ <password>123456</password>
+ </connector>
+ </connectors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Oops, something went wrong.

0 comments on commit 2ad93af

Please sign in to comment.