The problem is that the actual BastionBuilderImpl object does not enforce this order. A user can keep a reference to the object returned by Bastion.request() and call bind() twice in a row. We could figure out ways how to handle this, or we could save us all the trouble of supporting this and just restrict the user from calling it more than once.
Notice that a fix for this issue must also enforce that the user calls the above methods in the order listed. A user cannot first provide an Assertions<String> object using withAssertions(), for example, and then choose to call the bind() method with a different object.
The order in which methods are expected to be called on the Bastion builder are as follows:
The problem is that the actual
BastionBuilderImpl
object does not enforce this order. A user can keep a reference to the object returned byBastion.request()
and callbind()
twice in a row. We could figure out ways how to handle this, or we could save us all the trouble of supporting this and just restrict the user from calling it more than once.Notice that a fix for this issue must also enforce that the user calls the above methods in the order listed. A user cannot first provide an
Assertions<String>
object usingwithAssertions()
, for example, and then choose to call thebind()
method with a different object.