mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-04 09:19:39 +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)
|
||||
|
|
|
@ -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"`
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue