[Auth] Convert *Response classes to structs #14012
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I want to experiment with an alternative approach to #14006 where
AuthBackend
is instead made an actor. One of the first errors I hit when doing so is that theT.Response
types need to beSendable
. Making them structs satisfies that constraint. I'm breaking this up into it's own PR as it's a prereq to exploring an alternative approach to #14006 and will be needed in either approach.One important consideration when doing this is to ensure nothing depends on these new structures having reference semantics, else they may be left referencing an outdated copy. I audited all usages of
AuthBackend.call(request: Request) -> Request.Response
and the returned response was always a locally capturedlet
, so if the response would have been mutated, the response would have been assigned to avar
. Additionally, I would have expected to see something like:self.savedResponse = response
, etc.#no-changelog