Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize using mapstructure conversion instead of JSON marshalling. #1401

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Dec 30, 2023

  1. Serialize using mapstructure conversion instead of JSON marshalling.

    These changes remove the JSON encoding/decoding steps that are
    performed during the serialization of ini and dotenv files. This
    roundtrip loses type information during the transformation which
    causes values to be incorrectly converted to the JSON marshaller
    defaults (int becomes float64, bool becomes string, etc, etc). In
    place of this JSON encoding, the mapstructure library allows for a
    direct conversion between the Metadata struct and
    map[string]interface{} needed to leverage the stores.Flatten and
    stores.Unflatten functions.
    
    In addition this adds mapstructure tags to the metadata structures to
    allow backwards compatibility with the JSON encoding.
    
    Resolves getsops#879 & resolves getsops#857
    
    This is a re-submission of @acastle's getsops#1009 with mapstructure updated
    to v1.5.0 and unused imports removed applied to getsops/sops/main HEAD.
    slewsys committed Dec 30, 2023
    Configuration menu
    Copy the full SHA
    053c93d View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. Restore ConvertStructToMap to FlattenMetadata.

    Restore WeakDecode to UnflattenMetadata.
    slewsys committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    35d607b View commit details
    Browse the repository at this point in the history
  2. Encode non-string values with ValueToString.

    Remove unused privateKeySizeLimit.
    slewsys committed Jan 4, 2024
    Configuration menu
    Copy the full SHA
    bcd2490 View commit details
    Browse the repository at this point in the history