def set_destination_signature()

in kinto-remote-settings/src/kinto_remote_settings/signer/updater.py [0:0]


    def set_destination_signature(self, signature, source_attributes, request):
        # Push the new signature to the destination collection.
        parent_id = "/buckets/%s" % self.destination["bucket"]
        collection_id = "collection"

        collection_record = self.storage.get(
            parent_id=parent_id,
            resource_name=collection_id,
            object_id=self.destination["collection"],
        )

        # Update the collection_record
        new_collection = dict(**collection_record)
        new_collection.pop(FIELD_LAST_MODIFIED, None)
        new_collection["signature"] = signature
        for attr in PUBLISHED_COLLECTION_FIELDS:
            if attr in source_attributes:
                new_collection[attr] = source_attributes[attr]

        updated = self.storage.update(
            parent_id=parent_id,
            resource_name=collection_id,
            object_id=self.destination["collection"],
            obj=new_collection,
        )

        matchdict = dict(
            bucket_id=self.destination["bucket"], id=self.destination["collection"]
        )
        notify_resource_event(
            request,
            {"method": "PUT", "path": self.destination_collection_uri},
            matchdict=matchdict,
            resource_name="collection",
            parent_id=self.destination_bucket_uri,
            obj=updated,
            action=ACTIONS.UPDATE,
            old=collection_record,
        )