Skip to content

Commit

Permalink
Add comments to CSFLE consumer examples (#1893)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayokota authored Jan 7, 2025
1 parent e36d719 commit 92c83e7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion examples/avro_consumer_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,15 @@ def main(args):

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

avro_deserializer = AvroDeserializer(schema_registry_client,
schema_str,
dict_to_user)
dict_to_user,
rule_conf=rule_conf)

consumer_conf = {'bootstrap.servers': args.bootstrap_servers,
'group.id': args.group,
Expand Down
7 changes: 6 additions & 1 deletion examples/json_consumer_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,15 @@ def main(args):

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

json_deserializer = JSONDeserializer(schema_str,
dict_to_user,
schema_registry_client)
schema_registry_client,
rule_conf=rule_conf)

consumer_conf = {'bootstrap.servers': args.bootstrap_servers,
'group.id': args.group,
Expand Down
7 changes: 6 additions & 1 deletion examples/protobuf_consumer_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,15 @@ def main(args):

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

protobuf_deserializer = ProtobufDeserializer(user_pb2.User,
{'use.deprecated.format': False},
schema_registry_client)
schema_registry_client,
rule_conf=rule_conf)

consumer_conf = {'bootstrap.servers': args.bootstrap_servers,
'group.id': args.group,
Expand Down

0 comments on commit 92c83e7

Please sign in to comment.