Sha256: da41592aebf54ec5c6579e58eb5fa4907838f102c7086a6a8527c79e216c9364

Contents?: true

Size: 873 Bytes

Versions: 14

Compression:

Stored size: 873 Bytes

Contents

module Saml
  module Elements
    class Conditions
      include Saml::Base

      tag 'Conditions'
      namespace 'saml'

      attribute :not_before, Time, tag: 'NotBefore', on_save: lambda { |val| val.utc.xmlschema if val.present? }
      attribute :not_on_or_after, Time, tag: 'NotOnOrAfter', on_save: lambda { |val| val.utc.xmlschema if val.present? }

      has_one :audience_restriction, Saml::Elements::AudienceRestriction

      def initialize(*args)
        options = args.extract_options!
        @audience_restriction = Saml::Elements::AudienceRestriction.new(audience: options.delete(:audience)) if options[:audience]
        self.not_before       = Time.now - Saml::Config.max_issue_instant_offset.minutes
        self.not_on_or_after  = Time.now + Saml::Config.max_issue_instant_offset.minutes
        super(*(args << options))
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
libsaml-3.13.1 lib/saml/elements/conditions.rb
libsaml-3.13.0 lib/saml/elements/conditions.rb
libsaml-3.12.0 lib/saml/elements/conditions.rb
libsaml-3.11.0 lib/saml/elements/conditions.rb
libsaml-3.10.0 lib/saml/elements/conditions.rb
libsaml-3.9.3 lib/saml/elements/conditions.rb
libsaml-3.9.2 lib/saml/elements/conditions.rb
libsaml-3.9.1 lib/saml/elements/conditions.rb
libsaml-3.9.0 lib/saml/elements/conditions.rb
libsaml-3.8.0 lib/saml/elements/conditions.rb
libsaml-3.7.0 lib/saml/elements/conditions.rb
libsaml-3.6.0 lib/saml/elements/conditions.rb
libsaml-3.5.0 lib/saml/elements/conditions.rb
libsaml-3.4.0 lib/saml/elements/conditions.rb