def update_signature(self, signature, caveat): return binascii.unhexlify( sign_first_party_caveat( signature, caveat._caveat_id ) )
def add_first_party_caveat(self, macaroon, predicate, **kwargs): predicate = convert_to_bytes(predicate) caveat = Caveat(caveat_id=convert_to_bytes(predicate)) macaroon.caveats.append(caveat) encode_key = binascii.unhexlify(macaroon.signature_bytes) macaroon.signature = sign_first_party_caveat(encode_key, predicate) return macaroon