Sha256: bec7fe4c1f3bb584b2ae729d69b7cb6cdc9a191898328767bcc53991da108302

Contents?: true

Size: 928 Bytes

Versions: 13

Compression:

Stored size: 928 Bytes

Contents

require 'builder'
module SamlIdp
  class LogoutBuilder
    include Signable

    attr_accessor :response_id
    attr_accessor :issuer_uri
    attr_accessor :saml_slo_url
    attr_accessor :algorithm

    def initialize(response_id, issuer_uri, saml_slo_url, algorithm)
      self.response_id = response_id
      self.issuer_uri = issuer_uri
      self.saml_slo_url = saml_slo_url
      self.algorithm = algorithm
    end

    # this is an abstract base class.
    def build
      raise "#{self.class} must implement build method"
    end

    def reference_id
      self.response_id
    end

    def encoded
      @encoded ||= encode
    end

    def raw
      build
    end

    def encode
      Base64.strict_encode64(raw)
    end
    private :encode

    def response_id_string
      "_#{response_id}"
    end
    private :response_id_string

    def now_iso
      Time.now.utc.iso8601
    end
    private :now_iso
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
saml_idp-0.16.0 lib/saml_idp/logout_builder.rb
saml_idp-0.15.0 lib/saml_idp/logout_builder.rb
saml_idp-0.14.0 lib/saml_idp/logout_builder.rb
saml_idp-0.12.0 lib/saml_idp/logout_builder.rb
saml_idp-0.11.0 lib/saml_idp/logout_builder.rb
saml_idp-0.10.0 lib/saml_idp/logout_builder.rb
saml_idp-0.9.0 lib/saml_idp/logout_builder.rb
saml_idp-0.8.1 lib/saml_idp/logout_builder.rb
saml_idp-0.8.0 lib/saml_idp/logout_builder.rb
saml_idp-0.7.2 lib/saml_idp/logout_builder.rb
saml_idp-0.7.1 lib/saml_idp/logout_builder.rb
saml_idp-0.7.0 lib/saml_idp/logout_builder.rb
saml_idp-0.6.0 lib/saml_idp/logout_builder.rb