Skip to content

jfxdev/sops-saas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sops-saas

Integrated library wrapper for Mozilla SOPS, ideal for run encryption/decryption on apps and web services, without need to install the official binary.

Usage

import "github.com/jfxdev/sops-saas"
cypher := sops.NewCypher()

keys := []entities.EncryptionKey{
    {
        ID:       "arn:aws:kms:us-east-2:XXXXXXXXXXXX:key/YYYYYYYY-YYYY-YYYYY-YYYY-YYYYYYYYYYY",
        Platform: "aws/kms",
        Role:     "arn:aws:iam::XXXXXXXXXXXX:role/your-aws-role",
        Context:  map[string]string{"context": "sops"},
    }
x}

result, err := cypher.Encrypt(body, sops.EncryptionConfig{
		Keys:              keys,
		UnencryptedSuffix: "",
		EncryptedSuffix:   "",
		UnencryptedRegex:  "",
		EncryptedRegex:    "^(data)$",
		ShamirThreshold:   3,
		Format:            "yaml",
})

About

Integrated wrapper library for Mozilla SOPS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages