You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A secret with no format before .sops deploys as a JSON wrapper: token.sops lands as {"data": "..."}, not the token #977
A secret whose name carries no format before .sops, such as token.sops, deploys as a JSON wrapper instead of its plaintext.
Reproduced 2026-09-29 at 0cf30415 plus #974's branch, by a throwaway test deleted afterwards. It encrypted hunter2\n with writ's own encrypter (pkg/sopsNewEncrypter().Encrypt, path token), wrote it as myproj/token.sops, and deployed it with deploy.Execute:
Encrypting.pkg/sops/encrypter.go:68 infers binary for a name with no format, and sops's BinaryStore writes its encrypted document as JSON, so the file begins with {.
Decrypting.pkg/sops/decrypt.godetectFormat finds no inner extension, so its content fallback (:109-113, "starts with {" gives json) picks the JSON store. The JSON store's EmitPlainFile marshals the tree, {"data": …}. Only the binary store unwraps data.
Coverage.pkg/sops/decrypt_test.go's "json content detection" row pins this behavior, and cmd/writ/writ/deploy/sops_integration_test.go exercises only .yaml.sops and .yaml.tmpl.sops.
Found by the review of #974, whose writ guide first showed token.sops as its example. That guide now shows format-bearing names, and names this issue.
Resolution
Decryption uses the format the encryption used. A name with no inner extension decrypts as binary (its plaintext unwrapped), not by sniffing the ciphertext's first byte, which is always { for sops's JSON-wrapped binary documents. A deploy test covers the no-format case.
Activity
feat(writ): writ's templates end in .tmpl, and .template is left to o…