Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert upstream proxy does the traffic #327

Merged
merged 3 commits into from
Aug 21, 2023
Merged

assert upstream proxy does the traffic #327

merged 3 commits into from
Aug 21, 2023

Conversation

Choraden
Copy link
Contributor

@Choraden Choraden commented Aug 1, 2023

The assert only works for http endpoints.

@what-the-diff
Copy link

what-the-diff bot commented Aug 1, 2023

PR Summary

  • New Naming Feature in HTTPProxyConfig
    The HTTPProxyConfig, a part of our system configuration setup, now has a new functionality named 'name'. This update enhances our system's flexibility by adding new configurational controls.

  • Environment Variable Inclusion in UpstreamProxyService
    The 'UpstreamProxyService' function, which handles sending our data upstream, now includes the environment variable 'FORWARDER_NAME'. This means our upstream service will now have access to more specific system information.

  • Integration of 'runUpstream' Constant with Default and AuthSetups
    Both the DefaultsSetups and AuthSetups functions in our testing setup now include a new constant named 'runUpstream'. This inclusion helps improve our testing accuracy when evaluating upstream processes in both default and authorized setups.

  • Upstream Check Test Function Addition
    A new test function named 'TestUpstreamCheck' has been added to our proxy tests. This function helps ensure the correctness and efficiency of our new upstream functionalities.

  • New 'Name' Field Added to HTTPProxyConfig
    Along with the 'name' functionality, a new 'Name' field has also been added to the HTTPProxyConfig struct. This change is aimed at augmenting our system's configurability by presenting more labeling options.

  • Modification in 'Request' Method
    The 'Request' method in our httpexpect utility has now been tweaked to return a 'Response' struct, providing a more descriptive outcome compared to the previous 'resp'. This adjustment enhances the understandability of the method's output.

e2e/setups.go Outdated
@@ -131,7 +137,7 @@ func PacSetups() []setup.Setup {
AddService(
forwarder.HttpbinService()).
MustBuild(),
Run: "^TestProxy",
Run: "^TestProxy|^TestUpstreamCheck$",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call this test TestProxyUpstream and given the env variables it would ensure that upstream proxy is either used or not.

The name is used in the Via header in request. From now on users can specify custom names to represent their proxies.
Users can benefit from explicit access to response body.
The test checks if the traffic goes through the upstream-proxy.
It works only when the httpbin protocol is http.
@Choraden Choraden marked this pull request as ready for review August 18, 2023 09:37
@Choraden Choraden merged commit 93fb63e into main Aug 21, 2023
@Choraden Choraden deleted the hg/upstream-check branch August 21, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants