(outputStore sops.Store, branches []sops.TreeBranch)
| 67 | } |
| 68 | |
| 69 | func validateFileForEncryption(outputStore sops.Store, branches []sops.TreeBranch) (sops.UserError, int) { |
| 70 | if len(branches) < 1 { |
| 71 | return &needAtLeastOneDocument{}, codes.NeedAtLeastOneDocument |
| 72 | } |
| 73 | if outputStore.HasSopsTopLevelKey(branches[0]) { |
| 74 | return &fileAlreadyEncryptedError{}, codes.FileAlreadyEncrypted |
| 75 | } |
| 76 | return nil, 0 |
| 77 | } |
| 78 | |
| 79 | func metadataFromEncryptionConfig(config encryptConfig) sops.Metadata { |
| 80 | return sops.Metadata{ |
no test coverage detected