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

[BUG]: Auth + custom headers + SSL-cert support for async client #2489

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tazarov
Copy link
Contributor

@tazarov tazarov commented Jul 10, 2024

Closes #2488

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Added the support for auth provider in Async client
    • Added support for custom client-provided headers in Async client
    • Added support for SSL cert ignore or custom SSL certs via chroma_server_ssl_verify
    • Updated test rig for Auth tests
    • Updated test rig to support SSL tests for async
    • Fixed an issue with stale headers in async client

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

TBD

Copy link
Contributor Author

tazarov commented Jul 10, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @tazarov and the rest of your teammates on Graphite Graphite

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@tazarov tazarov requested a review from codetheweb July 10, 2024 12:04
@tazarov
Copy link
Contributor Author

tazarov commented Jul 10, 2024

Need to update negative tests for auth + ssl

@tazarov tazarov force-pushed the trayan-07-10-fix_adding_support_for_auth_custom_headers_and_ssl-cert_to_async_client branch from b2e1067 to a7b5caf Compare July 10, 2024 15:40
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We may have to detect whether it is an async client in tests and wrap that in asyncio task.

Copy link
Contributor

@codetheweb codetheweb left a comment

Choose a reason for hiding this comment

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

awesome

Comment on lines +124 to +125
else:
self._clients[loop_hash].headers.update(self._headers)
Copy link
Contributor

Choose a reason for hiding this comment

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

when would we need to update the headers like this?

Copy link
Contributor Author

@tazarov tazarov Jul 10, 2024

Choose a reason for hiding this comment

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

Tests were failing. I think it is due to having pytest use the same event loop - which caused async client to be reused with invalid credentials from prev test.

Copy link
Contributor

Choose a reason for hiding this comment

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

but the clients aren't globally cached, the cache is local to the class instance--seems strange

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, it took some time to figure out what the issue was. I can dig deeper to find why pytest does this.

@tazarov tazarov force-pushed the trayan-07-10-fix_adding_support_for_auth_custom_headers_and_ssl-cert_to_async_client branch 3 times, most recently from 3c51330 to b339f0f Compare July 11, 2024 20:10
@tazarov
Copy link
Contributor Author

tazarov commented Jul 16, 2024

@codetheweb, still investigating some failures in async client close that seems to attempt an async call on a terminated loop

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.

[Bug]: Lack of Auth, headers and SSL (custom PKI/ignore) for Async client
2 participants