ruby-saml-federa 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmNmMDFjZWM5YTljOWQzZWU5YjFjNzAwOGRhY2QzNGUwZTc2YTAwZg==
4
+ M2QyMDFjNDJkYjdkMzI2MmQ5M2RlYmVjMTc1N2Q5MTAxM2Y4Y2Y2OQ==
5
5
  data.tar.gz: !binary |-
6
- ZjE1YTRhYzc1MjJlYjdkNGZmMjQ0MzVjMjkyMDQwZGNjMTI3ZjhjNg==
6
+ ODA5MjI2ZjEzMzFjZTQwZTg2ODAwZWQwZmIyYWVkMTZjZmEzZDZmMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGM0OWUyNjdkNzJmOGI0N2Y0ZGNlNTRkMjkyMTIwZDY2ZmY5OTNlMGRmNTUw
10
- YWIyZGIxMDM2Mjc2NjhiNWEwNDc2NTk3ZjM1Mjc4YjI2ZDM2YTkwODQ0MWY3
11
- N2QyY2VmZDI3ODlhZWQ0NTllMjYwNDk4NjdhYWE4YzI0NjYzNzU=
9
+ YzRjOTMyYTEyMDU0ZTFlNTlhMTljZGViOTM4M2QwNzQ3MDY4NDk2NmJiZTBm
10
+ OTIzNzFhNWY3ZDNjNTE0ZjA3NGI1NDIzZTJlNDI5NDNhZTcwMjQzNTg3NjIx
11
+ NzljOWZmNjJkZmUzYmE3OTY3Zjc4NzUyYzRhMWQ3OGJiZmE0ZTE=
12
12
  data.tar.gz: !binary |-
13
- Yzk5MGQzN2E5Mjk0NDU5YzRiMDYyMDc3OGExMzNlNGE5NWI5NmMyYmE2Njlh
14
- NDU3MjdiYWNhYWJhZjE0YWEyODdmMTVkODY5ZjYyZmI1ZGE1MzViMjRjMmE3
15
- YTRjZmQzZTI1YThkM2FlZDg4YzlkZjJlODE2OWZhZDg5OTVlNDQ=
13
+ MDcyZmQwNGUxNjU3ZGVkMTY0ZDMwOTA5Mjk1MjNiOGYzMGQwNTZiZDU4ZjFm
14
+ MDg3YTk5M2NlNWJiNDY1NDYxYmNkYzFmZGZhYmY3ZTlhM2ZmNjE5M2Y3ZmJk
15
+ YzFhMWM2ODMzNTdmNzYyYWRhMWEwNWY0YThlMGI1NDdlNWI2ZTk=
@@ -14,7 +14,7 @@ module Federa::Saml
14
14
  HTTP_POST = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
15
15
  HTTP_GET = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
16
16
 
17
- attr_accessor :uuid, :request
17
+ attr_accessor :uuid, :request, :issue_instant
18
18
 
19
19
  def initialize( settings )
20
20
  @settings = settings
@@ -25,6 +25,7 @@ module Federa::Saml
25
25
  uuid = "_" + UUID.new.generate
26
26
  self.uuid = uuid
27
27
  time = Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ")
28
+ self.issue_instant = time
28
29
  # Create AuthnRequest root element using REXML
29
30
  request_doc = REXML::Document.new
30
31
  request_doc.context[:attribute_quote] = :quote
@@ -95,6 +95,8 @@ module Federa
95
95
  end
96
96
  end
97
97
 
98
+ #metodi per ricavare info per tracciatura agid
99
+
98
100
  def issuer
99
101
  @issuer ||= begin
100
102
  node = REXML::XPath.first(document, "/p:Response/a:Issuer", { "p" => PROTOCOL, "a" => ASSERTION })
@@ -103,6 +105,36 @@ module Federa
103
105
  end
104
106
  end
105
107
 
108
+ def response_to_id
109
+ node = REXML::XPath.first(document, "/p:Response", { "p" => PROTOCOL })
110
+ return node.attributes["InResponseTo"]
111
+ end
112
+
113
+ def id
114
+ node = REXML::XPath.first(document, "/p:Response", { "p" => PROTOCOL })
115
+ return node.attributes["ID"]
116
+ end
117
+
118
+ def issue_instant
119
+ node = REXML::XPath.first(document, "/p:Response", { "p" => PROTOCOL })
120
+ return node.attributes["IssueInstant"]
121
+ end
122
+
123
+ def assertion_id
124
+ node = REXML::XPath.first(document, "/p:Response/a:Assertion/", { "p" => PROTOCOL, "a" => ASSERTION })
125
+ return node.attributes["ID"]
126
+ end
127
+
128
+ def assertion_subject
129
+ node = REXML::XPath.first(document, "/p:Response/a:Assertion/a:Subject/a:NameID", { "p" => PROTOCOL, "a" => ASSERTION })
130
+ return node.text
131
+ end
132
+
133
+ def assertion_subject_name_qualifier
134
+ node = REXML::XPath.first(document, "/p:Response/a:Assertion/a:Subject/a:NameID", { "p" => PROTOCOL, "a" => ASSERTION })
135
+ return node.attributes["NameQualifier"]
136
+ end
137
+
106
138
  private
107
139
 
108
140
  def validation_error(message)
@@ -2,7 +2,7 @@ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ruby-saml-federa'
5
- s.version = '0.0.5'
5
+ s.version = '0.0.6'
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Fabiano Pavan"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-saml-federa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabiano Pavan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-20 00:00:00.000000000 Z
11
+ date: 2018-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: canonix