@@ -178,10 +178,38 @@ class Biscuit:
178178 # :rtype: Biscuit
179179 def append (self , block : BlockBuilder ) -> Biscuit : ...
180180
181+ # Create a new `Biscuit` by appending a third-party attenuation block
182+ #
183+ # :param external_key: the public key of the third-party that signed the block.
184+ # :type external_key: PublicKey
185+ # :param block: the third party block to append
186+ # :type block: ThirdPartyBlock
187+ # :return: the attenuated biscuit
188+ # :rtype: Biscuit
189+ def append_third_party (
190+ self ,
191+ external_key : PublicKey ,
192+ block : ThirdPartyBlock ,
193+ ) -> Biscuit : ...
194+
195+ # Create a third-party request for generating third-party blocks.
196+ #
197+ # :return: the third-party request
198+ # :rtype: ThirdPartyRequest
199+ def third_party_request (self ) -> ThirdPartyRequest : ...
200+
181201 # The revocation ids of the token, encoded as hexadecimal strings
182202 @property
183203 def revocation_ids (self ) -> List [str ]: ...
184204
205+ # Get the external key of a block if it exists
206+ #
207+ # :param index: the block index
208+ # :type index: int
209+ # :return: the public key if it exists
210+ # :rtype: str | None
211+ def block_external_key (self , index : int ) -> str | None : ...
212+
185213class AuthorizerBuilder :
186214 # Create a new authorizer from a datalog snippet and optional parameter values
187215 #
@@ -597,3 +625,23 @@ class UnverifiedBiscuit:
597625 @property
598626 def revocation_ids (self ) -> List [str ]: ...
599627 def verify (self , root : PublicKey ) -> Biscuit : ...
628+
629+ class ThirdPartyRequest :
630+ # Create a third-party block
631+ #
632+ # :param private_key: the third-party's private key used to sign the block
633+ # :type external_key: PrivateKey
634+ # :param block: the block builder to be signed
635+ # :type block: BlockBuilder
636+ # :return: a signed block that can be appended to a Biscuit
637+ # :rtype: ThirdPartyBlock
638+ #
639+ # :note: this method consumes the `ThirdPartyRequest` object.
640+ def create_block (
641+ self ,
642+ private_key : PrivateKey ,
643+ block : BlockBuilder
644+ ) -> ThirdPartyBlock : ...
645+
646+ class ThirdPartyBlock :
647+ pass
0 commit comments