Skip to content

feat: integrate proxy support for REST/gRPC/OIDC and add new OIDC authentication grant#539

Merged
bevzzz merged 4 commits intoweaviate:mainfrom
fer-marino:feature/system-props
Mar 18, 2026
Merged

feat: integrate proxy support for REST/gRPC/OIDC and add new OIDC authentication grant#539
bevzzz merged 4 commits intoweaviate:mainfrom
fer-marino:feature/system-props

Conversation

@fer-marino
Copy link
Copy Markdown

@fer-marino fer-marino commented Feb 23, 2026

This PR introduces comprehensive proxy support for both REST and gRPC communications, as well as for OIDC authentication.

Changes

Features

  • Proxy Support: Introduced a new Proxy record to hold proxy configuration (host, port, scheme, and optional credentials).
  • Global Configuration: Added a proxy(Proxy) method to the Config builder, allowing users to configure a proxy globally for all client operations.
  • New Authentication Method: Added resourceOwnerPasswordCredentials to the Authentication interface, supporting the Resource Owner Password Credentials authorization grant.
  • REST Transport Integration: Updated DefaultRestTransport to use the configured proxy with Apache HttpClient 5.
  • gRPC Transport Integration: Added proxy support for gRPC communication in DefaultGrpcTransport.
  • OIDC Proxy Support: Integrated proxy support into NimbusTokenProvider and OidcUtils, ensuring that OIDC metadata and token requests (fetching and refreshing) correctly respect the proxy settings.

Refactoring

  • Improved OIDC Metadata Handling: Refactored OIDC metadata fetching to be more robust and better integrated with the transport layer.

Testing

  • New Unit Tests: Added ProxyTest and updated AuthenticationTest to verify proxy integration for both REST requests and OIDC authentication flows (including Resource Owner Password grant).

Verification

  • Ran existing and new unit tests to confirm that proxy settings are correctly passed to the underlying transports.
  • Verified that OIDC token fetching works through a proxy by mocking the OIDC server responses.
  • Confirmed that gRPC communication respects the proxy configuration.

Copy link
Copy Markdown

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot
Copy link
Copy Markdown

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

@bevzzz
Copy link
Copy Markdown
Collaborator

bevzzz commented Feb 23, 2026

Nice addition, thank you @fer-marino

Copy link
Copy Markdown

@orca-security-eu orca-security-eu bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Warning SAST high 1   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca
🛡️ The following SAST misconfigurations have been detected
NAME FILE
high Prevent Server-Side Request Forgery (SSRF) via User Input in URLs ...ltGrpcTransport.java View in code

Note: The scan should have failed if no policies were configured in warn-only mode.

@fer-marino
Copy link
Copy Markdown
Author

oh sorry. I've added a lot more stuff. Using an http proxy proved much more difficult than I thought, so here is the implementation. I've also added an extra method for the OIDC authentication to use resourceOwnerPassword providing also a client secret id (needed if anon login is disabled)

@bevzzz
Copy link
Copy Markdown
Collaborator

bevzzz commented Mar 6, 2026

@fer-marino it's been a busy week, but I'm going to get back to this PR first thing Monday. Appreciate you taking time to contribute!

Using an http proxy proved much more difficult than I thought

Could you please elaborate on the difficulties you ran into with configuring http proxy via system properties? I guess one limitation of that approach would be that it doesn't allow using a different proxy per client. Was there something else you encountered?

Copy link
Copy Markdown
Collaborator

@bevzzz bevzzz left a comment

Choose a reason for hiding this comment

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

I suggest focusing this PR on adding proxy support and introduce ROPC authentication in a separate PR.

@fer-marino
Copy link
Copy Markdown
Author

hi, I've implemented most of your suggestions.

About my difficulties in implementing the proxy, is the different http libraries used by the different interfaces. My initial solution worked only for the rest transport, leaving out gRPC and OIDC authentication.

@bevzzz
Copy link
Copy Markdown
Collaborator

bevzzz commented Mar 9, 2026

Thanks! Could you please rebase your branch on the latest main -- I've just merged a PR that should skip OIDC Client Credentials test if the secret is not available in the CI environment (which it isn't for outside contributions). All tests should be passing again then.

Copy link
Copy Markdown
Collaborator

@bevzzz bevzzz left a comment

Choose a reason for hiding this comment

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

This is shaping up really well. Here are a couple more things I noticed.

Is there any simple test we could write for the HTTP / gRPC proxy configs? We're already using MockServer for some tests, can we extend the test suite to also verify request are being proxied correctly? e.g. using MockServer's proxying utility

@bevzzz
Copy link
Copy Markdown
Collaborator

bevzzz commented Mar 9, 2026

My initial solution worked only for the rest transport, leaving out gRPC and OIDC authentication.

Makes sense, yes. Thanks a lot for taking these two aspects into consideration.

@fer-marino
Copy link
Copy Markdown
Author

added some more test units, including one for the proxy. I've also modified the pom, as in my setup the lombok annotation processor was not getting invoked during unit tests execution.

@bevzzz
Copy link
Copy Markdown
Collaborator

bevzzz commented Mar 9, 2026

added some more test units, including one for the proxy

Thank you 👍

@fer-marino
Copy link
Copy Markdown
Author

pushed another commit with your suggestions

@bevzzz
Copy link
Copy Markdown
Collaborator

bevzzz commented Mar 10, 2026

@fer-marino please update your branch to the latest main state, there're some changes that should fix the failing tests in the pipeline.

+3 pending comments ⬆️

@fer-marino fer-marino requested a review from a team as a code owner March 10, 2026 13:04
@fer-marino
Copy link
Copy Markdown
Author

rebased

@fer-marino fer-marino changed the title use system props when creating the RestTransport feat: integrate proxy support for REST/gRPC/OIDC and add new OIDC authentication grant Mar 10, 2026
@bevzzz
Copy link
Copy Markdown
Collaborator

bevzzz commented Mar 11, 2026

@fer-marino looks like the commit hashes got changed in the rebase and the history/diff in this PR now includes changes already present in the main branch. Could you please squash your changes in to a single commit and force-push the branch?

Something like:

git reset --soft origin/main
git commit -m "feat: add proxy support and ROPC authorization grant"
git push --force-with-lease

It'll make it easier for me to wrap up the review.

@fer-marino fer-marino force-pushed the feature/system-props branch from 35a8d82 to 907f71b Compare March 12, 2026 08:13
@fer-marino
Copy link
Copy Markdown
Author

hi, have a look now

@bevzzz
Copy link
Copy Markdown
Collaborator

bevzzz commented Mar 13, 2026

hey @fer-marino! There's one unit test that's prone to deadlocks (it's causing the pipeline in this PR to hang rn), which was fixed in the #549. That PR just got merged to main -- could you please update your branch again?

@bevzzz
Copy link
Copy Markdown
Collaborator

bevzzz commented Mar 16, 2026

@fer-marino the commit hashes got changed after your latest rebase and the history/diff in this PR now includes changes already present in the main branch. Could you please squash your changes in to a single commit and force-push the branch?

Something like:

git reset --soft origin/main
git commit -m "feat: add proxy support and ROPC authorization grant"
git push --force-with-lease

It'll make it easier for me to wrap up the review.


Alternatively, you can always merge the main branch into your feature branch instead of rebasing them -- this should keep the original hashes intact and the diff focused.

@fer-marino fer-marino force-pushed the feature/system-props branch from 514f742 to 311dc69 Compare March 17, 2026 12:56
@bevzzz bevzzz self-requested a review March 18, 2026 10:06
@bevzzz
Copy link
Copy Markdown
Collaborator

bevzzz commented Mar 18, 2026

Some unit tests are failing seemingly after the merge, I'll fix them to unblock the PR.

Copy link
Copy Markdown
Collaborator

@bevzzz bevzzz left a comment

Choose a reason for hiding this comment

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

Congratulations on your first PR, @fer-marino!

@bevzzz bevzzz merged commit 391b875 into weaviate:main Mar 18, 2026
12 checks passed
@fer-marino fer-marino deleted the feature/system-props branch March 18, 2026 10:38
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.

3 participants