Commit 03aaabb
2017-11-20 16:46:33
1 parent
290e5d6
Changed files (5)
airport
app
controllers
proof
app
controllers
saml-kit
airport/app/controllers/metadata_controller.rb
@@ -1,8 +1,9 @@
class MetadataController < ApplicationController
+ force_ssl if: :ssl_configured?
skip_before_action :authenticate!
def show
- render xml: to_xml
+ render xml: to_xml, content_type: "application/samlmetadata+xml"
end
private
@@ -12,4 +13,8 @@ class MetadataController < ApplicationController
Sp.default(request).to_xml
end
end
+
+ def ssl_configured?
+ !Rails.env.development?
+ end
end
airport/Gemfile.lock
@@ -2,8 +2,8 @@ PATH
remote: ../saml-kit
specs:
saml-kit (0.1.0)
- activemodel (~> 5.1)
- activesupport (~> 5.1)
+ activemodel (>= 4.2.0)
+ activesupport (>= 4.2.0)
builder (~> 3.2)
nokogiri (~> 1.8)
xmldsig (~> 0.6)
@@ -261,4 +261,4 @@ DEPENDENCIES
webmock
BUNDLED WITH
- 1.15.4
+ 1.16.0
proof/app/controllers/metadata_controller.rb
@@ -1,6 +1,8 @@
class MetadataController < ApplicationController
+ force_ssl if: :ssl_configured?
+
def show
- render xml: to_xml
+ render xml: to_xml, content_type: "application/samlmetadata+xml"
end
private
@@ -10,4 +12,8 @@ class MetadataController < ApplicationController
Idp.default(request).to_xml
end
end
+
+ def ssl_configured?
+ !Rails.env.development?
+ end
end
proof/Gemfile.lock
@@ -2,8 +2,8 @@ PATH
remote: ../saml-kit
specs:
saml-kit (0.1.0)
- activemodel (~> 5.1)
- activesupport (~> 5.1)
+ activemodel (>= 4.2.0)
+ activesupport (>= 4.2.0)
builder (~> 3.2)
nokogiri (~> 1.8)
xmldsig (~> 0.6)
@@ -265,4 +265,4 @@ DEPENDENCIES
webmock
BUNDLED WITH
- 1.15.4
+ 1.16.0
saml-kit/saml-kit.gemspec
@@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
- spec.add_dependency "activemodel", "~> 4.2"
- spec.add_dependency "activesupport", "~> 4.2"
+ spec.add_dependency "activemodel", ">= 4.2.0"
+ spec.add_dependency "activesupport", ">= 4.2.0"
spec.add_dependency "builder", "~> 3.2"
spec.add_dependency "nokogiri", "~> 1.8"
spec.add_dependency "xmldsig", "~> 0.6"