ruby-saml-federa 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/federa/ruby-saml/authrequest.rb +2 -1
- data/lib/federa/ruby-saml/response.rb +32 -0
- data/ruby-saml-federa.gemspec +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                M2QyMDFjNDJkYjdkMzI2MmQ5M2RlYmVjMTc1N2Q5MTAxM2Y4Y2Y2OQ==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                ODA5MjI2ZjEzMzFjZTQwZTg2ODAwZWQwZmIyYWVkMTZjZmEzZDZmMg==
         | 
| 7 7 | 
             
            SHA512:
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                YzRjOTMyYTEyMDU0ZTFlNTlhMTljZGViOTM4M2QwNzQ3MDY4NDk2NmJiZTBm
         | 
| 10 | 
            +
                OTIzNzFhNWY3ZDNjNTE0ZjA3NGI1NDIzZTJlNDI5NDNhZTcwMjQzNTg3NjIx
         | 
| 11 | 
            +
                NzljOWZmNjJkZmUzYmE3OTY3Zjc4NzUyYzRhMWQ3OGJiZmE0ZTE=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 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)
         | 
    
        data/ruby-saml-federa.gemspec
    CHANGED
    
    | @@ -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 | 
            +
              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. | 
| 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:  | 
| 11 | 
            +
            date: 2018-07-17 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: canonix
         |