From 17ac8d1ec2474229f7624fd16686558bc1dc41a2 Mon Sep 17 00:00:00 2001 From: Nox Date: Tue, 8 Dec 2015 18:34:54 +0100 Subject: [PATCH 1/2] Keep attributes with 'cas' prefix --- lib/rack-cas/service_validation_response.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/rack-cas/service_validation_response.rb b/lib/rack-cas/service_validation_response.rb index 1e1b7ec..821b3dc 100644 --- a/lib/rack-cas/service_validation_response.rb +++ b/lib/rack-cas/service_validation_response.rb @@ -53,6 +53,9 @@ def extra_attributes if !node.namespace || !node.namespace.prefix == 'cas' # TODO: support JSON encoding attrs[node.name] = YAML.load node.text.strip + else + attrs['cas'] = [] unless attrs['cas'] + attrs['cas'] << { node.name => YAML.load(node.text.strip) } end end end From b7776cbbab669ff5774fa6dc1a0d06c1032276ba Mon Sep 17 00:00:00 2001 From: Nox Date: Wed, 9 Dec 2015 11:19:23 +0100 Subject: [PATCH 2/2] Update extra_attributes["cas"] is now a hash and not an array of hashes --- lib/rack-cas/service_validation_response.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rack-cas/service_validation_response.rb b/lib/rack-cas/service_validation_response.rb index 821b3dc..3cf973d 100644 --- a/lib/rack-cas/service_validation_response.rb +++ b/lib/rack-cas/service_validation_response.rb @@ -54,8 +54,8 @@ def extra_attributes # TODO: support JSON encoding attrs[node.name] = YAML.load node.text.strip else - attrs['cas'] = [] unless attrs['cas'] - attrs['cas'] << { node.name => YAML.load(node.text.strip) } + attrs['cas'] = {} unless attrs['cas'] + attrs['cas'][node.name] = YAML.load(node.text.strip) end end end