shotover / shotover-proxy

L7 data-layer proxy
https://docs.shotover.io
Apache License 2.0
84 stars 16 forks source link

scram_over_mtls task minor refactor #1638

Closed rukai closed 4 months ago

rukai commented 4 months ago

This PR is a minor refactor of the scram over mtls task:

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.

codspeed-hq[bot] commented 4 months ago

CodSpeed Performance Report

Merging #1638 will not alter performance

Comparing rukai:scram_over_mtls-task-minor-refactor (34e1d0b) with main (65b280b)

Summary

✅ 37 untouched benchmarks