Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-11061

Two Sensitive instances with the same value are not equal

    XMLWordPrintable

Details

    • Needs Assessment
    • Enhancement
    • Hide
      Previously two instances of type Sensitive would not compare as equal if their underlying strings were equal. This patch changed that behavior allowing comparisons such as '$a = Sensitive("secret"); $b = Sensitive("secret"); notice($a == $b)' to return true.
      Show
      Previously two instances of type Sensitive would not compare as equal if their underlying strings were equal. This patch changed that behavior allowing comparisons such as '$a = Sensitive("secret"); $b = Sensitive("secret"); notice($a == $b)' to return true.
    • Needs Assessment

    Description

      Puppet Version: 7.6.0

      Two instances of lib/puppet/pops/types/p_sensitive_type.rb Sensitive with the same value are not equal. The class is just using default object id for equality.

      Desired Behavior:

      jpartlow@work1804:~/work/src/puppet$ puppet apply -e '$a = Sensitive("secret"); $b = Sensitive("secret"); notice($a == $b)'
      Notice: Scope(Class[main]): true
      Notice: Compiled catalog for work1804.platform9.puppet.net in environment production in 0.03 seconds
      Notice: Applied catalog in 0.08 seconds
      

      Actual Behavior:

      jpartlow@work1804:~/work/src/puppet$ puppet apply -e '$a = Sensitive("secret"); $b = Sensitive("secret"); notice($a == $b)'
      Notice: Scope(Class[main]): false
      Notice: Compiled catalog for work1804.platform9.puppet.net in environment production in 0.03 seconds
      Notice: Applied catalog in 0.08 seconds
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            joshua.partlow Joshua Partlow
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support