getsops / getsops/sops

Can't use --input-type for exec-file

Open
#652 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

Describe the problem

There is no way to force subcommand exec-file to use a specific input format with the --input-type.

How to reproduce

$ cat test.yaml
superSecret: ENC[AES256_GCM,data:NtahnsRDqbVULO3sH2jPnw==,iv:caX9CGdMKnDukieQTRfa52QFgNvaf86GALZR67uolX8=,tag:Yni0LEXnSM3BpWhC8lt+MA==,type:str]
sops:
    kms: []
    gcp_kms: []
    azure_kv: []
    lastmodified: '2020-04-14T15:01:38Z'
    mac: ENC[AES256_GCM,data:l2TQUc+PkDKwv+cb1RTo7v8C/4ej5X+byT7DYVowIm13GvGgET05V/R/LadjrZya/aGnSBTUZ87iitiFQvmQmpelxcvoxYOE5fh/Me7uNV7hWRJk8qilHL0zZleApuS32KXK0QVXtgKJ911AQ4tcfeaBz8RdneJb8p31lD7iR3M=,iv:GhLe9YQYP7b2hIP2nzD2wflP+u21t6mhjJldFiM9pYs=,tag:l1IxV/U3T7tU4M4WjGglhA==,type:str]
    pgp:
    -   created_at: '2020-04-14T15:01:37Z'
        enc: |-
            -----BEGIN PGP MESSAGE-----
            <REMOVED>
            -----END PGP MESSAGE-----
        fp: <REMOVED>
    unencrypted_suffix: _unencrypted
    version: 3.5.0

$ cp test.yaml test

$ sops exec-file test.yaml 'cat {}'
superSecret: superSecretValue

$ sops --input-type yaml exec-file test 'cat {}'
Error unmarshalling input json: invalid character 's' looking for beginning of value

Expected behaviour

That the flag --input-type should force sops to decrypt as yaml format.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documented exec-file commands and trace how the --input-type flag is handled for that subcommand. Done means using --input-type yaml with an extensionless input decrypts successfully instead of attempting JSON unmarshalling.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, yaml
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.