-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
197 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'rails/generators' | ||
|
||
module SpRailsSaml | ||
class ConfigGenerator < Rails::Generators::Base | ||
|
||
desc "このジェネレータはconfig/initializersにイニシャライザファイルを作成する" | ||
|
||
def create_initializer_file | ||
create_file "config/initializers/sp-rails-saml.rb", default_initializer | ||
end | ||
|
||
private | ||
|
||
def default_initializer | ||
<<-EOS | ||
SpRailsSaml::Settings.setup do |config| | ||
config.sp_entity_id = '' | ||
config.name_identifier_format = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' | ||
config.authn_context = 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509' | ||
config.authn_context_comparison = 'exact' | ||
config.assertion_consumer_service_url = '' | ||
end | ||
EOS | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require "active_support" | ||
require 'sp-rails-saml/settings' | ||
require 'generators/sp-rails-saml/config_generator' | ||
|
||
module SpRailsSaml | ||
class Error < StandardError; end | ||
end |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
RSpec.describe SpRailsSaml::ConfigGenerator, type: :generator do | ||
destination File.expand_path("../../../../tmp", __FILE__) | ||
|
||
before(:all) do | ||
prepare_destination | ||
run_generator | ||
end | ||
|
||
let(:initializer_text) do | ||
<<-EOS | ||
SpRailsSaml::Settings.setup do |config| | ||
config.sp_entity_id = '' | ||
config.name_identifier_format = 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress' | ||
config.authn_context = 'urn:oasis:names:tc:SAML:2.0:ac:classes:X509' | ||
config.authn_context_comparison = 'exact' | ||
config.assertion_consumer_service_url = '' | ||
end | ||
EOS | ||
end | ||
|
||
it "should create saml_settings initializer file" do | ||
assert_file "config/initializers/sp-rails-saml.rb", initializer_text | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters