8000 Add region tags to JWT refresh. (#1300) · johnmanong/python-docs-samples@9cb102f · GitHub
[go: up one dir, main page]

Skip to content

Commit 9cb102f

Browse files
noerogJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
Add region tags to JWT refresh. (GoogleCloudPlatform#1300)
1 parent 7d16203 commit 9cb102f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

iot/api-client/mqtt_example/cloudiot_mqtt_example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ def main():
219219
args.registry_id, args.device_id, i)
220220
print('Publishing message {}/{}: \'{}\''.format(
221221
i, args.num_messages, payload))
222+
# [START iot_mqtt_jwt_refresh]
222223
seconds_since_issue = (datetime.datetime.utcnow() - jwt_iat).seconds
223224
if seconds_since_issue > 60 * jwt_exp_mins:
224225
print('Refreshing token after {}s').format(seconds_since_issue)
@@ -229,7 +230,7 @@ def main():
229230
args.registry_id, args.device_id, args.private_key_file,
230231
args.algorithm, args.ca_certs, args.mqtt_bridge_hostname,
231232
args.mqtt_bridge_port)
232-
233+
# [END iot_mqtt_jwt_refresh]
233234
# Publish "payload" to the MQTT topic. qos=1 means at least once
234235
# delivery. Cloud IoT Core also supports qos=0 for at most once
235236
# delivery.

0 commit comments

Comments
 (0)
0