Skip to content

Commit 92c83e7

Browse files
authored
Add comments to CSFLE consumer examples (#1893)
1 parent e36d719 commit 92c83e7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

examples/avro_consumer_encryption.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,15 @@ def main(args):
9898

9999
sr_conf = {'url': args.schema_registry}
100100
schema_registry_client = SchemaRegistryClient(sr_conf)
101+
rule_conf = None
102+
# KMS credentials can be passed as follows
103+
# rule_conf = {'secret.access.key': 'xxx', 'access.key.id': 'yyy'}
104+
# Alternatively, the KMS credentials can be set via environment variables
101105

102106
avro_deserializer = AvroDeserializer(schema_registry_client,
103107
schema_str,
104-
dict_to_user)
108+
dict_to_user,
109+
rule_conf=rule_conf)
105110

106111
consumer_conf = {'bootstrap.servers': args.bootstrap_servers,
107112
'group.id': args.group,

examples/json_consumer_encryption.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,15 @@ def main(args):
9595

9696
sr_conf = {'url': args.schema_registry}
9797
schema_registry_client = SchemaRegistryClient(sr_conf)
98+
rule_conf = None
99+
# KMS credentials can be passed as follows
100+
# rule_conf = {'secret.access.key': 'xxx', 'access.key.id': 'yyy'}
101+
# Alternatively, the KMS credentials can be set via environment variables
98102

99103
json_deserializer = JSONDeserializer(schema_str,
100104
dict_to_user,
101-
schema_registry_client)
105+
schema_registry_client,
106+
rule_conf=rule_conf)
102107

103108
consumer_conf = {'bootstrap.servers': args.bootstrap_servers,
104109
'group.id': args.group,

examples/protobuf_consumer_encryption.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,15 @@ def main(args):
6969

7070
sr_conf = {'url': args.schema_registry}
7171
schema_registry_client = SchemaRegistryClient(sr_conf)
72+
rule_conf = None
73+
# KMS credentials can be passed as follows
74+
# rule_conf = {'secret.access.key': 'xxx', 'access.key.id': 'yyy'}
75+
# Alternatively, the KMS credentials can be set via environment variables
7276

7377
protobuf_deserializer = ProtobufDeserializer(user_pb2.User,
7478
{'use.deprecated.format': False},
75-
schema_registry_client)
79+
schema_registry_client,
80+
rule_conf=rule_conf)
7681

7782
consumer_conf = {'bootstrap.servers': args.bootstrap_servers,
7883
'group.id': args.group,

0 commit comments

Comments
 (0)