| OLD | NEW |
| 1 # Copyright 2015 The LUCI Authors. All rights reserved. | 1 # Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Manages PubSub topic that receives notifications about AuthDB changes. | 5 """Manages PubSub topic that receives notifications about AuthDB changes. |
| 6 | 6 |
| 7 The topic is hosted in auth_service Cloud Project and auth_service manages its | 7 The topic is hosted in auth_service Cloud Project and auth_service manages its |
| 8 IAM policies. | 8 IAM policies. |
| 9 | 9 |
| 10 All service accounts listed in 'auth-trusted-services' group are entitled for | 10 All service accounts listed in 'auth-trusted-services' group are entitled for |
| 11 a subscription to AuthDB change notifications, so that they can pull AuthDB | 11 a subscription to AuthDB change notifications, so that they can pull AuthDB |
| 12 snapshots as soon as they are available. | 12 snapshots as soon as they are available. |
| 13 | 13 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 msg.revision.auth_db_rev = state.auth_db_rev | 103 msg.revision.auth_db_rev = state.auth_db_rev |
| 104 msg.revision.modified_ts = utils.datetime_to_timestamp(state.modified_ts) | 104 msg.revision.modified_ts = utils.datetime_to_timestamp(state.modified_ts) |
| 105 | 105 |
| 106 blob = msg.SerializeToString() | 106 blob = msg.SerializeToString() |
| 107 key_name, sig = signature.sign_blob(blob) | 107 key_name, sig = signature.sign_blob(blob) |
| 108 | 108 |
| 109 pubsub.publish(topic_name(), blob, { | 109 pubsub.publish(topic_name(), blob, { |
| 110 'X-AuthDB-SigKey-v1': key_name, | 110 'X-AuthDB-SigKey-v1': key_name, |
| 111 'X-AuthDB-SigVal-v1': base64.b64encode(sig), | 111 'X-AuthDB-SigVal-v1': base64.b64encode(sig), |
| 112 }) | 112 }) |
| OLD | NEW |