This PR is a minor refactor of the scram over mtls task:
create_delegation_token_for_user is renamed to create_delegation_token_for_user_with_wait
And a new create_delegation_token_for_user is created which performs the actual token creation.
In order for the token creation logic to live in sub function, we need a way to take ownership of the parsed contents of a message so that we can return it.
So I added a into_frame() method on Message to allow for this.
Usually we cant take ownership of a message because we need to return it back to the client, but in this case shotover requested this message so its free to consume/destroy it if needed.
We could alternatively have just cloned the frame, but this approach is cheaper and I expect this method will be useful in the future as well.
This refactor simplifies the implementation of broker discovery in a follow up PR.
This PR is a minor refactor of the scram over mtls task:
create_delegation_token_for_user
is renamed tocreate_delegation_token_for_user_with_wait
create_delegation_token_for_user
is created which performs the actual token creation.In order for the token creation logic to live in sub function, we need a way to take ownership of the parsed contents of a message so that we can return it. So I added a
into_frame()
method onMessage
to allow for this. Usually we cant take ownership of a message because we need to return it back to the client, but in this case shotover requested this message so its free to consume/destroy it if needed. We could alternatively have just cloned the frame, but this approach is cheaper and I expect this method will be useful in the future as well.This refactor simplifies the implementation of broker discovery in a follow up PR.