Skip to content

Commit

Permalink
Support permissioned decryption and encryption
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshatM committed Oct 29, 2020
1 parent c60b800 commit 8cd8167
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,15 @@ func Marshal(m proto.Message) ([]byte, error) {
recursiveCrypt(m, decryptMode)
return proto.Marshal(m)
}

// Meant for cases where you might want to get a value
func PermissionedDecrypt(text string) string {
// todo: use policies here!
return decrypt(text)
}

// Meant for cases where you might want to set a value
func PermissionedEncrypt(text string) string {
// todo: use policies here!
return encrypt(text)
}

0 comments on commit 8cd8167

Please sign in to comment.