Skip to content

Commit

Permalink
Add sops sub package
Browse files Browse the repository at this point in the history
  • Loading branch information
heppu committed Nov 8, 2023
1 parent d21a3a4 commit edc2352
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sops.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ package mageutil
import (
"context"

"github.com/getsops/sops/v3/decrypt"
"github.com/elisasre/mageutil/sops"
)

// SopsDecryptFile decrypts sops file.
func SopsDecryptFile(_ context.Context, file string) ([]byte, error) {
return decrypt.File(file, "")
// Deprecated: use sub package.
func SopsDecryptFile(ctx context.Context, file string) ([]byte, error) {
return sops.DecryptFile(ctx, file)
}

// SopsDecryptWithAwsEnv uses aws-vault to temporarily set credentials in env for decryption functionality.
// Deprecated: use sub packages.
func SopsDecryptWithAwsEnv(ctx context.Context, file, profile string) ([]byte, error) {
var data []byte
if err := AwsWithEnvCredentials(ctx, profile, func() error {
Expand Down
13 changes: 13 additions & 0 deletions sops/sops.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Package sops provides sops decrypting functionality.
package sops

import (
"context"

"github.com/getsops/sops/v3/decrypt"
)

// DecryptFile decrypts sops file.
func DecryptFile(_ context.Context, file string) ([]byte, error) {
return decrypt.File(file, "")
}

0 comments on commit edc2352

Please sign in to comment.