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

Add a Binary type and runtime object

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.8.0
    • Component/s: Language
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      Hide

      This is the first step in adding a Binary Type. The criteria for this step are:

      • It should be possible to create a Binary from:
        • a base64 encoded strings in strict, relaxed, and URL safe base64 encoding
        • a file (any content)
        • an Array of integer byte values, including an empty array
      • convert a Binary
        • to String using different formats (base64 strict, relaxed, URL safe), as opaque redacted 'binary' or "Binary" string value, or as an Array of Integers
        • to Array of Integers
      • It should be possible to access one or more of the bytes using [n] or [n, n] syntax (as with a String) to produce a new Binary with the selected sub-sequence
      • It should be possible to use a Binary value as contents of a File resource
      Show
      This is the first step in adding a Binary Type. The criteria for this step are: It should be possible to create a Binary from: a base64 encoded strings in strict, relaxed, and URL safe base64 encoding a file (any content) an Array of integer byte values, including an empty array convert a Binary to String using different formats (base64 strict, relaxed, URL safe), as opaque redacted 'binary' or "Binary" string value, or as an Array of Integers to Array of Integers It should be possible to access one or more of the bytes using [n] or [n, n] syntax (as with a String) to produce a new Binary with the selected sub-sequence It should be possible to use a Binary value as contents of a File resource
    • Team:
      Puppet Developer Experience
    • Story Points:
      3
    • Sprint:
      PDS 2016-09-21, PDS 2016-10-05
    • Release Notes:
      New Feature
    • Release Notes Summary:
      The type system and runtime now supports binary data by using the Binary type. It allows binary content to be created from plain text and base 64 encoded text.

      Description

      We currently do not have a way of handling binary content in Puppet. Instead we use String values. This is bad because we cannot handle all binary data since we expect strings to be valid UTF-8 text. Thus we need a separate runtime object, and consequently a new type in the type system.

      We also want these for efficient binary serialization as it would be a shame to serialize binary data in Base64 encoding i a binary format.

      The name of the type should be Binary. It does not in itself hold information about its content (that is, no mime type or similar) as such a feature is subject to where and how the object is used.

      • A Binary type matches all Binary instances.
      • The Binary type is derived from Any
      • Two Binary instances are equal if their content is equal

      It should be possible to create a Binary from a String; verbatim bytes, or as one of three possible Base64 encodings (relaxed, strict, URL-safe).
      The base64 encoding should follow RFC 3548 or RFC 4648 with mandatory '=' padding and unlimited line length and accept both \n and \r\n as line ending and being insensitive to all whitespace, all non base 64 non whitespace characters are forbidden.

      Note, the base 64 encoding here has nothing to do with how the Binary is serialized as that depends on the serialization format.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  henrik.lindberg Henrik Lindberg
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: