Sha256: 8633a7ace88711ead88a7b75ac6538a0d27c251285cd9c89385a9bf06f2aecec

Contents?: true

Size: 917 Bytes

Versions: 4

Compression:

Stored size: 917 Bytes

Contents

module Saml
  module Kit
    module XmlTemplatable
      include ::Xml::Kit::Templatable

      def template_path
        root_path = File.expand_path(File.dirname(__FILE__))
        template_name = "#{self.class.name.split("::").last.underscore}.builder"
        File.join(root_path, "builders/templates/", template_name)
      end

      # Returns true if an embedded signature is requested and at least one signing certificate is available via the configuration.
      def sign?
        return configuration.sign? if embed_signature.nil?
        (embed_signature && configuration.sign?) ||
          (embed_signature && @signing_key_pair.present?)
      end

      def digest_method
        configuration.digest_method
      end

      def signature_method
        configuration.signature_method
      end

      def signing_key_pair
        configuration.key_pairs(use: :signing).last
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
saml-kit-1.0.6 lib/saml/kit/xml_templatable.rb
saml-kit-1.0.5 lib/saml/kit/xml_templatable.rb
saml-kit-1.0.4 lib/saml/kit/xml_templatable.rb
saml-kit-1.0.3 lib/saml/kit/xml_templatable.rb