Session catalog#2836
Draft
DerGut wants to merge 4 commits into
Draft
Conversation
Collaborator
|
I literally just proposed this idea last week in the rust community sync, and very happy to see some actual work already! There are some existing work on AuthManager/Session, maybe we should merge the effort? #2815 |
Contributor
Author
|
@CTTY What a coincidence! I was planning to attend myself to push for it, so thanks for covering the topic! 🙏 On #2815, this is perfect timing too. I was about to start some work on the AuthManager (according to #2774 (comment)) but that doesn't seem necessary anymore 👏 They're 100% related, but it already looks like a reasonable split to contribute them sequentially. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
What changes are included in this PR?
This PR introduces a new session-aware catalog trait
SessionCatalogand its implementationRestSessionCatalog.A
SessionCatalogis a session-aware catalog variant that accepts a new structSessionContextwith every catalog method. It is otherwise identical to the regularCatalogtrait.The
RestSessionCatalognow acts as the core implementation of theRestCatalog, which simply delegates all its methods to an innerRestSessionCatalogby passing an internalSessionContextthat defaults to an empty one, preserving session unaware behavior.Are these changes tested?
The existing test suite passes on the refactor that moves logic from the
RestCatalogto theRestSessionCatalog(first commit). I've included some additional tests to assert the RestCatalogBuilder's output when passed an explicit session.I'm adding a commit to refactor the test suit, to have it operate on the
RestSessionCataloginstead, as it now contains the load-bearing logic.Logic that uses the sessions to modify requests isn't implemented yet, so tests at this point are only structural. My 2nd PR will address this.