Sha256: 5fd20678f618cebc16d9bc076deb5326032d37f0ade9b4b2f3205545cdacb4c5
Contents?: true
Size: 726 Bytes
Versions: 19
Compression:
Stored size: 726 Bytes
Contents
# frozen_string_literal: true module Saml module Kit class Conditions include XmlParseable attr_reader :content def initialize(node) @to_nokogiri = node @content = node.to_s end def started_at parse_iso8601(at_xpath('./@NotBefore').try(:value)) end def expired_at parse_iso8601(at_xpath('./@NotOnOrAfter').try(:value)) end def audiences search('./saml:AudienceRestriction/saml:Audience').map(&:text) end private def parse_iso8601(value) DateTime.parse(value) rescue StandardError => error Saml::Kit.logger.error(error) Time.at(0).to_datetime end end end end
Version data entries
19 entries across 19 versions & 1 rubygems