getsops / getsops/sops

sops ignores the `--input-type` flag

Open
#1,168 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/CLI area/documentation
Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

First run with a .gitignore file extension. The file is not treated as an ENV file despite the --input-type dotenv flag.

❯ sops -e --input-type dotenv cloud/sops_kms/prod_secrets.gitignore                 
{
        "REMOVED": "ENC[AES256_GCM,data:REMOVED,type:str]",
        "sops": {
                "kms": [
                        {
                                "arn": "REMOVED",
                                "enc": "REMOVED",
                                "aws_profile": ""
                        }
                ],
                "gcp_kms": null,
                "azure_kv": null,
                "hc_vault": null,
                "age": null,
                "lastmodified": "2023-01-23T23:22:46Z",
                "mac": "ENC[AES256_GCM,data:REMOVED,type:str]",
                "pgp": null,
                "unencrypted_suffix": "_unencrypted",
                "version": "3.7.3"
        }
}

Compare with a second run where I've renamed the file to have a .env extension:

❯ sops -e --input-type dotenv cloud/sops_kms/prod_secrets.gitignore.env
REMOVED=ENC[AES256_GCM,data:REMOVED,type:str]
sops_unencrypted_suffix=_unencrypted
sops_kms__list_0__map_created_at=2023-01-23T23:23:13Z
sops_kms__list_0__map_enc=REMOVED
sops_mac=ENC[AES256_GCM,data:REMOVED,type:str]
sops_version=3.7.3
sops_lastmodified=2023-01-23T23:23:14Z
sops_kms__list_0__map_arn=REMOVED
sops_kms__list_0__map_aws_profile=

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

Reproduce the issue with the two sops commands shown, comparing the .gitignore and .env results. Trace the CLI handling of --input-type and filename-based format detection. Done means --input-type dotenv produces dotenv-formatted encrypted output for a .gitignore-named file as well as for a .env file.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.