saml2 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saml2/base.rb +6 -1
- data/lib/saml2/message.rb +1 -0
- data/lib/saml2/response.rb +3 -0
- data/lib/saml2/version.rb +1 -1
- data/spec/lib/bindings/http_redirect_spec.rb +2 -0
- data/spec/lib/response_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c776c54f1dc7f9b26b39544abd6bdde6c2f68a1f28339627ad9d8745cdfc4ee7
|
4
|
+
data.tar.gz: 703170dd49abeb43b09070b6000f748737d1ccbe0374b154c274f84065935daa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74fe75be6913966fd33a9e72535398a2ecc6916f483aeb47b3202afba09fb175b3c2234c8dfb63a0d48b1aa9f3536204635471e0ab73c125b8276d063838e7cb
|
7
|
+
data.tar.gz: dd4f61cc065ebfc647c4306a084b56e5eb5fd57877898f05a67a09c5df87837f34d8c503ca933aa2f50cc770f44e6712bc0ee9192a0f9d07a48d8fb4a974154f
|
data/lib/saml2/base.rb
CHANGED
@@ -11,11 +11,16 @@ module SAML2
|
|
11
11
|
|
12
12
|
attr_reader :xml
|
13
13
|
|
14
|
+
def initialize
|
15
|
+
@pretty = true
|
16
|
+
end
|
17
|
+
|
14
18
|
def from_xml(node)
|
15
19
|
@xml = node
|
16
20
|
end
|
17
21
|
|
18
|
-
def to_s(pretty:
|
22
|
+
def to_s(pretty: nil)
|
23
|
+
pretty = @pretty if pretty.nil?
|
19
24
|
if xml
|
20
25
|
xml.to_s
|
21
26
|
elsif pretty
|
data/lib/saml2/message.rb
CHANGED
data/lib/saml2/response.rb
CHANGED
data/lib/saml2/version.rb
CHANGED
data/spec/lib/response_spec.rb
CHANGED
@@ -42,14 +42,14 @@ module SAML2
|
|
42
42
|
expect(Schemas.protocol.validate(response.to_xml)).to eq []
|
43
43
|
# verifiable on the command line with:
|
44
44
|
# xmlsec1 --verify --pubkey-cert-pem certificate.pem --privkey-pem privatekey.key --id-attr:ID urn:oasis:names:tc:SAML:2.0:assertion:Assertion response_signed.xml
|
45
|
-
expect(response.to_s
|
45
|
+
expect(response.to_s).to eq fixture('response_signed.xml')
|
46
46
|
end
|
47
47
|
|
48
48
|
it "should generate a valid signature when attributes are present" do
|
49
49
|
freeze_response
|
50
50
|
response.assertions.first.statements << sp.attribute_consuming_services.default.create_statement('givenName' => 'cody')
|
51
51
|
response.sign(fixture('certificate.pem'), fixture('privatekey.key'))
|
52
|
-
expect(response.to_s
|
52
|
+
expect(response.to_s).to eq fixture('response_with_attribute_signed.xml')
|
53
53
|
end
|
54
54
|
|
55
55
|
it "should generate valid XML for IdP initiated response" do
|