Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(strm-2247): use data contract 1.5.0 #140

Merged
merged 1 commit into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cmd/simulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var SimulateCmd = &cobra.Command{

func init() {
flags := SimulateCmd.PersistentFlags()
flags.String(random_events.SchemaFlag, "strmprivacy/example/1.3.0", "Which schema to use for creating simulated events")
flags.String(random_events.SchemaFlag, "strmprivacy/example/1.5.0", "Which schema to use for creating simulated events")
_ = SimulateCmd.RegisterFlagCompletionFunc(random_events.SchemaFlag, schemaCompletion)
SimulateCmd.AddCommand(random_events.RunCmd())
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/entity/schema_code/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ make this fully operational in your development setting (using a JDK, a Python o
### Usage`

var example = util.DedentTrim(`
strm get schema-code strmprivacy/example/1.3.0 --language=python
strm get schema-code strmprivacy/example/1.5.0 --language=python
Saved to python-avro-example-1.3.0.zip
`)
var languages = []string{"java", "typescript", "python", "rust"}
Expand Down
4 changes: 2 additions & 2 deletions pkg/entity/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
saveFlag = "save"
maskedFieldsFlag = "masked-fields"
maskedFieldsSeed = "mask-seed"
maskedFieldHelp = `-M strmprivacy/example/1.3.0:sensitiveValue,consistentValue \
maskedFieldHelp = `-M strmprivacy/example/1.5.0:sensitiveValue,consistentValue \
-M strmprivacy/clickstream/1.0.0:sessionId

Masks fields values in the output stream via hashing.
Expand Down Expand Up @@ -125,7 +125,7 @@ func create(args []string, cmd *cobra.Command) {
}

/*
-M strmprivacy/example/1.3.0:sensitiveValue,anotherOne \
-M strmprivacy/example/1.5.0:sensitiveValue,anotherOne \
-M dpg/nps_unified/v3:kiosk_v1,customer_id --masked_fields_file
*/
func parseMaskedFields(flags *pflag.FlagSet) *entities.MaskedFields {
Expand Down
4 changes: 2 additions & 2 deletions pkg/simulator/random_events/event_generators.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func createRandomDemoEvent(consentLevels []int32, sessionId string) StrmPrivacyE

event.StrmMeta = &demoschema.StrmMeta{
ConsentLevels: consentLevels,
EventContractRef: "strmprivacy/example/1.3.0",
EventContractRef: "strmprivacy/example/1.5.0",
}
event.ConsistentValue = sessionId
event.UniqueIdentifier = createUnionString(fmt.Sprintf("unique-%d", rand.Intn(100)))
Expand All @@ -27,7 +27,7 @@ func createRandomDemoEvent(consentLevels []int32, sessionId string) StrmPrivacyE
}

var EventGenerators = map[string]func([]int32, string) StrmPrivacyEvent{
"strmprivacy/example/1.3.0": createRandomDemoEvent,
"strmprivacy/example/1.5.0": createRandomDemoEvent,
}

func createUnionString(s string) *demoschema.UnionNullString {
Expand Down
8 changes: 4 additions & 4 deletions pkg/web_socket/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ var example = util.DedentTrim(`
# Simulate some events
strm create stream test
strm simulate random-events test
Starting to simulate random strmprivacy/example/1.3.0 events to stream test. Sending one event every 1000 ms.
Starting to simulate random strmprivacy/example/1.5.0 events to stream test. Sending one event every 1000 ms.
Sent 5 events
Sent 10 events

# And in another terminal

strm listen web-socket test
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.3.0", "nonce": 1782462093, "timestamp": 1669990806395, "keyLink": "e6f...
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.3.0", "nonce": 1159687711, "timestamp": 1669990807404, "keyLink": "b58...
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.3.0", "nonce": -192240390, "timestamp": 1669990808413, "keyLink": "ba0...
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.5.0", "nonce": 1782462093, "timestamp": 1669990806395, "keyLink": "e6f...
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.5.0", "nonce": 1159687711, "timestamp": 1669990807404, "keyLink": "b58...
{"strmMeta": {"eventContractRef": "strmprivacy/example/1.5.0", "nonce": -192240390, "timestamp": 1669990808413, "keyLink": "ba0...
`)

var WebSocketCmd = &cobra.Command{
Expand Down