util.registry.torrent: stash kid in JWT headers

Upstream, chihaya reads this header in order to find the kid in the list
of maintained keys. A long time ago, it used to just iterate, but now it
needs to know the kid.
This commit is contained in:
Jimmy Zelinskie 2017-06-08 13:51:13 -04:00
parent 7d07c2ed07
commit a16b469d9b

View file

@ -40,7 +40,8 @@ def jwt_from_infohash(infohash_digest):
'aud': ANNOUNCE_URL,
'infohash': hexlify(infohash_digest),
}
return jwt.encode(token_data, instance_keys.local_private_key, 'RS256')
return jwt.encode(token_data, instance_keys.local_private_key, algorithm='RS256',
headers={'kid': instance_keys.local_key_id})
def make_torrent(name, webseed, length, piece_length, pieces):