core/zero: add pseudonymization key (#5290)

This commit is contained in:
Caleb Doxsey 2024-09-19 14:43:01 -06:00 committed by GitHub
parent 9d6b656fbe
commit bfc782ff06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 44 additions and 20 deletions

View file

@ -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)

View file

@ -27,6 +27,7 @@ type BootstrapConfig struct {
// DatabrokerStorageConnection databroker storage connection string
DatabrokerStorageConnection *string `json:"databrokerStorageConnection,omitempty"`
OrganizationId string `json:"organizationId"`
PseudonymizationKey []byte `json:"pseudonymizationKey"`
// SharedSecret shared secret
SharedSecret []byte `json:"sharedSecret"`

View file

@ -197,6 +197,9 @@ components:
description: databroker storage connection string
organizationId:
type: string
pseudonymizationKey:
type: string
format: byte
sharedSecret:
type: string
format: byte
@ -204,6 +207,7 @@ components:
required:
- clusterId
- organizationId
- pseudonymizationKey
- sharedSecret
Bundle: