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

#657 Ability to set UseDefaultCredentials per route #1521

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

Sacrilege
Copy link

@Sacrilege Sacrilege commented Sep 22, 2021

Closes #657

Support setting WebClient.UseDefaultCredentials per route if needed.

Docs

@clintonbale
Copy link

Would be nice to get this merged in. Very useful PR.

@Sacrilege
Copy link
Author

Sacrilege commented Aug 8, 2022

What will it take to get this merged in to main?
@TomPallister

stefancruz added a commit to stefancruz/Ocelot that referenced this pull request Dec 22, 2022
@raman-m
Copy link
Member

raman-m commented May 16, 2023

@Sacrilege Hi Troy!
Could you resolve merge conflicts please?
And what issue is this PR related to?

@raman-m raman-m added invalid Not actually an issue waiting Waiting for answer to question or feedback from issue raiser labels May 16, 2023
@raman-m raman-m marked this pull request as draft May 16, 2023 17:33
@raman-m raman-m marked this pull request as ready for review July 11, 2023 11:53
@raman-m raman-m added proposal Proposal for a new functionality in Ocelot and removed invalid Not actually an issue waiting Waiting for answer to question or feedback from issue raiser labels Jul 11, 2023
@raman-m raman-m self-requested a review July 11, 2023 11:57
@raman-m
Copy link
Member

raman-m commented Aug 28, 2023

The feature branch has been rebased onto ThreeMammals:develop successfully!
Welcome to code review!

@raman-m
Copy link
Member

raman-m commented Aug 28, 2023

@Sacrilege commented on Aug 8, 2022

I hope, merging will happen soon... 🤣

@raman-m raman-m changed the title added ability to set UseDefaultCredentials per route Ability to set UseDefaultCredentials per route Aug 28, 2023
@raman-m raman-m requested review from omdahl, Z-byte-prog, binarymash, jps, geffzhang and RaynaldM and removed request for Z-byte-prog and omdahl August 28, 2023 17:07
@raman-m
Copy link
Member

raman-m commented Apr 16, 2024

The branch has been rebased onto release/24.0 with top commit 59b63ea !

jlukawska and others added 7 commits April 18, 2024 19:30
* routing based on headers (all specified headers must match)

* routing based on headers for aggregated routes

* unit tests and small modifications

* find placeholders in header templates

* match upstream headers to header templates

* find placeholders name and values, fix regex for finding placeholders values

* fix unit tests

* change header placeholder pattern

* unit tests

* unit tests

* unit tests

* unit tests

* extend validation with checking upstreamheadertemplates, acceptance tests for cases from the issue

* update docs and minor changes

* SA1649 File name should match first type name

* Fix compilation errors by code review after resolving conflicts

* Fix warnings

* File-scoped namespaces

* File-scoped namespace

* Target-typed 'new' expressions (C# 9).
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0/target-typed-new

* IDE1006 Naming rule violation: These words must begin with upper case characters: should_*

* Target-typed 'new' expressions (C# 9).
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0/target-typed-new

* Fix build errors

* DownstreamRouteBuilder

* AggregatesCreator

* IUpstreamHeaderTemplatePatternCreator, RoutesCreator

* UpstreamHeaderTemplatePatternCreator

* FileAggregateRoute

* FileAggregateRoute

* FileRoute

* Route, IRoute

* FileConfigurationFluentValidator

* OcelotBuilder

* DownstreamRouteCreator

* DownstreamRouteFinder

* HeaderMatcher

* DownstreamRouteFinderMiddleware

* UpstreamHeaderTemplate

* Routing folder

* RoutingBasedOnHeadersTests

* Refactor acceptance tests

* AAA pattern in unit tests

* CS8936: Feature 'collection expressions' is not available in C# 10.0.
Please use language version 12.0 or greater.

* Code review by @RaynaldM

* Convert facts to one `Theory`

* AAA pattern

* Add traits

* Update routing.rst

Check grammar and style

* Update docs

---------

Co-authored-by: raman-m <dotnet044@gmail.com>
* feature written, tests passed

* actualy passes almost all the test.

* resolve conflict, hopefully.

* please.

* let it cook.

* uses constants instead of string for version policies.

* conflict res

* swapped downstream method and version.

* ThreeMammals#1731 Read the Docs configuration file v2 (ThreeMammals#1733)

* fixing the documentation, using Release/20.0 as base branch

* using latest conf.py, created with sphinx-quickstart, fixing the warnings during documentation generation

* Update .readthedocs.yaml

* switching to threemammals.org for copyright

* adding requirements file, updating readthedocs.yaml, adding formats pdf / epub and config for requirements file

* fixing code block in websockets.rst

* ok, now it should be fine...

* Update kubernetes.rst: Review and fix markup code

* Update websockets.rst: Review and fix markup

* Update conf.py: Update release, author and copyright

---------

Co-authored-by: Raman Maksimchuk <dotnet044@gmail.com>

* * When using the QoS option "ExceptionsAllowedBeforeBreaking" the circuit breaker never opens the circuit.

* merge issue, PortFinder

* some code improvements, using httpresponsemessage status codes as a base for circuit breaker

* Adding more unit tests, and trying to mitigate the test issues with the method "GivenThereIsAPossiblyBrokenServiceRunningOn"

* fixing some test issues

* setting timeout value to 5000 to avoid side effects

* again timing issues

* timing issues again

* ok, first one ok

* Revert "ok, first one ok"

This reverts commit 2e4a673.

* inline method

* putting back logging for http request exception

* removing logger configuration, back to default

* adding a bit more tests to check the policy wrap

* Removing TimeoutStrategy from parameters, it's set by default to pessimistic, at least one policy will be returned, so using First() in circuit breaker and removing the branch Policy == null from delegating handler.

* Fix StyleCop warnings

* Format parameters

* Sort usings

* since we might have two policies wrapped,  timeout and circuit breaker, we can't use the name CircuitBreaker for polly qos provider, it's not right. Using PollyPolicyWrapper and AsnycPollyPolicy instead.

* modifying circuit breaker delegating handler name, usin Polly policies instead

* renaming CircuitBreakerFactory to PolicyWrapperFactory in tests

* DRY for FileConfiguration, using FileConfigurationFactory

* Add copy constructor

* Refactor setup

* Use expression body for method

* Fix acceptance test

* IDE1006 Naming rule violation: These words must begin with upper case characters

* CA1816 Change ReturnsErrorTests.Dispose() to call GC.SuppressFinalize(object)

* Sort usings

* Use expression body for method

* Return back named arguments

---------

Co-authored-by: raman-m <dotnet044@gmail.com>

* feature written, tests passed

* actualy passes almost all the test.

* resolve conflict, hopefully.

* missed this one.

* please.

* come on...

* let it build.

* let it cook.

* copied from main branch.

* conflict res

* resolving conflicts.

* another attempt.

* lf

* re-incorporate downstream version policy.

* renamed the version policies and added acceptance tests.

* trust the dotnet dev cert.

* accepts cert from dotnet.

* Fix compiling errors

* Refactor tests

* a bit of code cleanup, removing some usings

* a bit more cleanup in fileroute

* try and error with the tests

* "Yahoo!...", said @ibnuda :)

* FileRoute: let it go...
Binary copy! :LoL:

* FileRoute: let it cook...
Re-add sweet props

* `dotnet dev-certs` for the `build` job

* Recover `kubernetes.rst`

* docs/make.bat original version

* OcelotBuilderExtensions

* original src/Ocelot.Provider.Polly/v7/PollyPolicyWrapper.cs

* `IVersionPolicyCreator` XML docs

* Code review by @raman-m (part 1)

* RequestMapper : care about diff

* Code review by @raman-m (part 2)

* Fix Should_return_OK_status_and_multiline_indented_json_response_with_json_options_for_custom_builder

* Update configuration.rst

Add DownstreamVersionPolicy section

* Update docs

* Rename `DownstreamVersionPolicy` to `DownstreamHttpVersionPolicy`

* update docs after prop renaming

* Sort props

---------

Co-authored-by: Guillaume Gnaegi <58469901+ggnaegi@users.noreply.github.com>
Co-authored-by: Raman Maksimchuk <dotnet044@gmail.com>
@raman-m
Copy link
Member

raman-m commented Apr 26, 2024

@ggnaegi commented on April 3:

Mocking UseDefaultCredentials in an acceptance test on Linux hosts could be quite a pain...

Indeed, it can be challenging. However, we could set up a Windows build machine as a Docker image and direct CircleCI to execute the Windows build by downloading the image with the Windows OS from Docker Hub.
Have you encountered similar issues in your development?

Roadmap

  • Write all tests and verify them locally using the Visual Studio IDE on Windows OS. Ensure all tests pass.
  • Conduct initial builds on CircleCI using our existing ocelot2/circleci-build image with Linux OS aka Alpine 3.xx. It's likely that some tests will fail.
  • Develop a new Docker image based on Windows OS and upload it to the ocelot2 account. All three .NET SDKs must be preinstalled.
  • Modify the existing build.cake script and/or CircleCI configuration in the repository to detect Windows build scenarios and dynamically create the necessary Windows OS image container. This may present a DevOps challenge, but CircleCI workflows should offer some functionality to select the desired Docker image based on a condition.
  • Achieve a successful build on CircleCI with all checks passing.

Links

@raman-m
Copy link
Member

raman-m commented Apr 26, 2024

TODO

  • Expand unit testing, particularly for the MessageInvokerPool class
  • Conduct acceptance testing, including trials on a Windows machine

@ggnaegi
Copy link
Member

ggnaegi commented Apr 26, 2024

TODO

  • Expand unit testing, particularly for the MessageInvokerPool class
  • Conduct acceptance testing, including trials on a Windows machine

So, you're expecting that quality level from our side and you merged some stuff this week out of the blue...

Ok fine then.

@raman-m raman-m changed the base branch from release/24.0 to develop June 13, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2023 Annual 2023 release feature A new feature high High priority proposal Proposal for a new functionality in Ocelot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ocelot not working with a Windows Authentication