Skip to content

Commit 036d77b

Browse files
committed
Version 2.0.0 of the ruby-saml-example. Uses Rails4 and ruby-saml > 0.8.1
1 parent 4b86afa commit 036d77b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1972
-8204
lines changed

Gemfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'ruby-saml', '>=0.8.1'
4+
5+
gem 'byebug'
6+
7+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
8+
gem 'rails', '4.1.5'
9+
# Use sqlite3 as the database for Active Record
10+
gem 'sqlite3'
11+
# Use SCSS for stylesheets
12+
gem 'sass-rails', '~> 4.0.3'
13+
# Use Uglifier as compressor for JavaScript assets
14+
#gem 'uglifier', '>= 1.3.0'
15+
# Use CoffeeScript for .js.coffee assets and views
16+
#gem 'coffee-rails', '~> 4.0.0'
17+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
18+
# gem 'therubyracer', platforms: :ruby
19+
20+
# Use jquery as the JavaScript library
21+
#gem 'jquery-rails'
22+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
23+
#gem 'turbolinks'
24+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
25+
gem 'jbuilder', '~> 2.0'
26+
# bundle exec rake doc:rails generates the API under doc/api.
27+
#gem 'sdoc', '~> 0.4.0', group: :doc
28+
29+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
30+
gem 'spring', group: :development
31+
32+
# Use ActiveModel has_secure_password
33+
# gem 'bcrypt', '~> 3.1.7'
34+
35+
# Use unicorn as the app server
36+
# gem 'unicorn'
37+
38+
# Use Capistrano for deployment
39+
# gem 'capistrano-rails', group: :development
40+
41+
# Use debugger
42+
# gem 'debugger', group: [:development, :test]
43+

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Welcome to the ruby-saml project example for Rails2 / Rails3
2-
============================================================
1+
Welcome to the ruby-saml project example for Rails4
2+
===================================================
33

44
Rails is a web-application framework that includes everything needed to create
55
database-backed web applications according to the Model-View-Control pattern.
@@ -29,7 +29,7 @@ link:files/vendor/rails/actionpack/README.html.
2929
Supported Version
3030
-----------------
3131

32-
This ruby-saml-example project works with rails2 and rails3 and uses is compatible with the ruby-saml toolkit < 0.7.3.
32+
This ruby-saml-example project works with rails4 and uses is compatible with the ruby-saml toolkit >= 0.8.1.
3333

3434
Getting Started
3535
---------------
@@ -150,7 +150,7 @@ Debugger
150150
Debugger support is available through the debugger command when you start your Mongrel or
151151
Webrick server with --debugger. This means that you can break out of execution at any point
152152
in the code, investigate and change the model, AND then resume execution!
153-
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
153+
You need to install byebug to run the server in debugging mode. With gems, use 'gem install byebug'
154154

155155
Example:
156156

@@ -229,7 +229,12 @@ Description of Contents
229229
Holds the template files for layouts to be used with views. This models the common
230230
header/footer method of wrapping views. In your views, define a layout using the
231231
<tt>layout :default</tt> and create a file named default.html.erb. Inside default.html
232-
232+
233+
**app/views/saml**
234+
Contains templates used in the saml views:
235+
complete.html.erb displays the attribute list of the user
236+
fail.html.erb displays an error
237+
233238
**.erb,**
234239
call <% yield %> to render the view using this layout.
235240

@@ -263,4 +268,4 @@ Description of Contents
263268
Unit and functional tests along with fixtures. When using the script/generate scripts, template test files will be generated for you and placed in this directory.
264269

265270
**vendor**
266-
External libraries that the application depends on. Also includes the plugins subdirectory. If the app has frozen rails, those gems also go here, under vendor/rails/. This directory is in the load path.
271+
External libraries that the application depends on. Also includes the plugins subdirectory. If the app has frozen rails, those gems also go here, under vendor/rails/. This directory is in the load path.

Rakefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Add your own tasks in files placed in lib/tasks ending in .rake,
22
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
33

4-
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
4+
require File.expand_path('../config/application', __FILE__)
55

6-
require 'rake'
7-
require 'rake/testtask'
8-
require 'rake/rdoctask'
9-
10-
require 'tasks/rails'
6+
Rails.application.load_tasks

app/assets/images/.keep

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file.
9+
//
10+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require_tree .

app/assets/javascripts/saml.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Place all the behaviors and hooks related to the matching controller here.
2+
// All this logic will automatically be available in application.js.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* This is a manifest file that'll be compiled into application.css, which will include all the files
3+
* listed below.
4+
*
5+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7+
*
8+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9+
* compiled file so the styles you add here take precedence over styles defined in any styles
10+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11+
* file per style scope.
12+
*
13+
*= require_tree .
14+
*= require_self
15+
*/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place all the styles related to the saml controller here.
2+
// They will automatically be included in application.css.
3+
// You can use Sass (SCSS) here: http://sass-lang.com/
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
class ApplicationController < ActionController::Base
2-
protect_from_forgery
3-
4-
before_filter :force_plugin_reload
5-
6-
def force_plugin_reload
7-
ActiveSupport::Dependencies.load_file "xml_sec.rb" if "development" == RAILS_ENV
8-
ActiveSupport::Dependencies.load_file "xmlcanonicalizer.rb" if "development" == RAILS_ENV
9-
end
2+
# Prevent CSRF attacks by raising an exception.
3+
# For APIs, you may want to use :null_session instead.
4+
protect_from_forgery with: :exception
105
end

app/controllers/concerns/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)