mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-21 10:38:08 +02:00
core/zero: add pseudonymization key (#5290)
This commit is contained in:
parent
9d6b656fbe
commit
bfc782ff06
9 changed files with 44 additions and 20 deletions
|
@ -8,8 +8,8 @@ import (
|
|||
)
|
||||
|
||||
// Pseudonymize pseudonymizes data by computing the HMAC-SHA256 of the data.
|
||||
func Pseudonymize(organizationID string, data string) string {
|
||||
h := hmac.New(sha256.New, []byte(organizationID))
|
||||
func Pseudonymize(key []byte, data string) string {
|
||||
h := hmac.New(sha256.New, key)
|
||||
_, _ = io.WriteString(h, data)
|
||||
bs := h.Sum(nil)
|
||||
return base64.StdEncoding.EncodeToString(bs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue