feat: Implement ResponseInterceptor#341
Open
sakinsete wants to merge 2 commits into
Open
Conversation
This commit introduces the `ResponseInterceptor` protocol and its registry, enabling developers to intercept and modify SDK-generated responses. Key changes: - Added `ResponseInterceptor.swift` defining the protocol for response interception. - Added `ResponseInterceptorRegistry.swift` in FRCore to manage an array of `ResponseInterceptor` instances. - Added `FRResponseInterceptorRegistry.swift` in FRAuth as a wrapper for the FRCore registry. - Updated `RestClient.swift` to incorporate response interception logic, similar to existing request interception. - Made `Response` struct properties public for accessibility. - Renamed `interceptors` to `requestInterceptors` in `RestClient.swift` for clarity. - Updated project files to include the new response interceptor files.
Contributor
|
Hi @sakinsete thank you for creating this PR. We will be reviewing and posting our updates here. Apologies for the late reply. Can you please also provide some further details and a use case on why this feature is needed and the use cases you are trying to solve? Kind regards, |
Author
|
@george-bafaloukas-forgerock So we have a scenario where we are intercepting the response from Forgerock and sending this to shape sdk from F5 that we use internally for security purpose. |
Author
|
@george-bafaloukas-forgerock Please is there any update on reviewing this PR? |
Signed-off-by: sakinsete <sakinsete@westjet.com>
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.
Description
This commit introduces the
ResponseInterceptorprotocol and its registry, enabling developers to intercept and modify SDK-generated responses.Key changes:
ResponseInterceptor.swiftdefining the protocol for response interception.ResponseInterceptorRegistry.swiftin FRCore to manage an array ofResponseInterceptorinstances.FRResponseInterceptorRegistry.swiftin FRAuth as a wrapper for the FRCore registry.RestClient.swiftto incorporate response interception logic, similar to existing request interception.Responsestruct properties public for accessibility.interceptorstorequestInterceptorsinRestClient.swiftfor clarity.