Skip to content

Commit

Permalink
fix: set data subject field in the create event contract request (#115)
Browse files Browse the repository at this point in the history
Co-authored-by: Bob van den Hoogen <bob@strmprivacy.io>
  • Loading branch information
bobvandenhoogen and Bob van den Hoogen authored Sep 2, 2022
1 parent a8e9e2f commit 0c5a2d8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/spf13/cobra v1.3.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.10.0
github.com/strmprivacy/api-definitions-go/v2 v2.51.0
github.com/strmprivacy/api-definitions-go/v2 v2.53.1
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
google.golang.org/grpc v1.46.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/strmprivacy/api-definitions-go/v2 v2.51.0 h1:ib6cKBNR0kLwKrSuoh8JSg024u9Qbs1fD08gvmc04T4=
github.com/strmprivacy/api-definitions-go/v2 v2.51.0/go.mod h1:3uFjMuBEQSzrRQzaKEgIrLbBWRdya9DTYCQZqyS7nEw=
github.com/strmprivacy/api-definitions-go/v2 v2.53.1 h1:3EEWoH14FlNYu9/cMCDOW6iKG0PgGgVeWhJ387FMnr8=
github.com/strmprivacy/api-definitions-go/v2 v2.53.1/go.mod h1:3uFjMuBEQSzrRQzaKEgIrLbBWRdya9DTYCQZqyS7nEw=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
Expand Down
20 changes: 11 additions & 9 deletions pkg/entity/event_contract/event_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ var client event_contracts.EventContractsServiceClient
var apiContext context.Context

type EventContractDefinition struct {
KeyField string `json:"keyField"`
PiiFields map[string]int32 `json:"piiFields"`
Validations []*entities.Validation `json:"validations"`
KeyField string `json:"keyField"`
PiiFields map[string]int32 `json:"piiFields"`
Validations []*entities.Validation `json:"validations"`
DataSubjectField string `json:"dataSubjectField"`
}

func ref(refString *string) *entities.EventContractRef {
Expand Down Expand Up @@ -108,12 +109,13 @@ func create(cmd *cobra.Command, contractReference *string) {
req := &event_contracts.CreateEventContractRequest{
ProjectId: common.ProjectId,
EventContract: &entities.EventContract{
Ref: ref(contractReference),
SchemaRef: schema.Ref(&schemaRef),
IsPublic: isPublic,
KeyField: definition.KeyField,
PiiFields: definition.PiiFields,
Validations: definition.Validations,
Ref: ref(contractReference),
SchemaRef: schema.Ref(&schemaRef),
IsPublic: isPublic,
KeyField: definition.KeyField,
PiiFields: definition.PiiFields,
Validations: definition.Validations,
DataSubjectField: definition.DataSubjectField,
},
}

Expand Down

0 comments on commit 0c5a2d8

Please sign in to comment.