Comparing changes

v1.0.17 v1.0.18
4 commits 6 files changed

Commits

7012119 bump version. mo 2018-08-09 23:17:02
61d7d05 fix lint errors. mo 2018-08-09 23:15:37
88673a0 fix deprecated attributes. mo 2018-08-09 23:10:31
a887166 remove optional fields mo 2018-08-09 22:59:49
Changed files (6)
lib
spec
saml
kit
lib/saml/kit/builders/templates/assertion.builder
@@ -24,7 +24,7 @@ xml.Assertion(assertion_options) do
   if assertion_attributes.any?
     xml.AttributeStatement do
       assertion_attributes.each do |key, value|
-        xml.Attribute Name: key, NameFormat: Saml::Kit::Namespaces::URI, FriendlyName: key do
+        xml.Attribute Name: key do
           xml.AttributeValue value.to_s
         end
       end
lib/saml/kit/deprecated/metadata.rb
@@ -0,0 +1,17 @@
+module Saml
+  module Kit
+    class Metadata
+      # @deprecated
+      def organization_name
+        Saml::Kit.deprecate('`organization_name` is deprecated. Use `organization.name`')
+        organization.name
+      end
+
+      # @deprecated
+      def organization_url
+        Saml::Kit.deprecate('`organization_url` is deprecated. Use `organization.url`')
+        organization.url
+      end
+    end
+  end
+end
lib/saml/kit/organization.rb
@@ -19,18 +19,6 @@ module Saml
       def url
         at_xpath('./md:OrganizationURL').try(:text)
       end
-
-      # @deprecated
-      def organization_name
-        Saml::Kit.deprecate('`organization_name` is deprecated. Use `organization.name`')
-        name
-      end
-
-      # @deprecated
-      def organization_url
-        Saml::Kit.deprecate('`organization_url` is deprecated. Use `organization.url`')
-        url
-      end
     end
   end
 end
lib/saml/kit/version.rb
@@ -2,6 +2,6 @@
 
 module Saml
   module Kit
-    VERSION = '1.0.17'.freeze
+    VERSION = '1.0.18'.freeze
   end
 end
lib/saml/kit.rb
@@ -41,6 +41,7 @@ require 'saml/kit/default_registry'
 require 'saml/kit/logout_response'
 require 'saml/kit/logout_request'
 require 'saml/kit/metadata'
+require 'saml/kit/deprecated/metadata'
 require 'saml/kit/null_assertion'
 require 'saml/kit/organization'
 require 'saml/kit/parser'
spec/saml/kit/builders/response_spec.rb
@@ -90,13 +90,9 @@ RSpec.describe Saml::Kit::Builders::Response do
       expect(hash['Response']['Assertion']['AuthnStatement']['AuthnContext']['AuthnContextClassRef']).to eql('urn:oasis:names:tc:SAML:2.0:ac:classes:Password')
 
       expect(hash['Response']['Assertion']['AttributeStatement']['Attribute'][0]['Name']).to eql('email')
-      expect(hash['Response']['Assertion']['AttributeStatement']['Attribute'][0]['FriendlyName']).to eql('email')
-      expect(hash['Response']['Assertion']['AttributeStatement']['Attribute'][0]['NameFormat']).to eql('urn:oasis:names:tc:SAML:2.0:attrname-format:uri')
       expect(hash['Response']['Assertion']['AttributeStatement']['Attribute'][0]['AttributeValue']).to eql(email)
 
       expect(hash['Response']['Assertion']['AttributeStatement']['Attribute'][1]['Name']).to eql('created_at')
-      expect(hash['Response']['Assertion']['AttributeStatement']['Attribute'][1]['FriendlyName']).to eql('created_at')
-      expect(hash['Response']['Assertion']['AttributeStatement']['Attribute'][1]['NameFormat']).to eql('urn:oasis:names:tc:SAML:2.0:attrname-format:uri')
       expect(hash['Response']['Assertion']['AttributeStatement']['Attribute'][1]['AttributeValue']).to be_present
     end