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

Short-circuit API rate limiter for unauthenticated users #607

Merged
merged 9 commits into from
Jan 16, 2024

Conversation

debanjum
Copy link
Member

@debanjum debanjum commented Jan 11, 2024

Major

  • ba99089 Short-circuit API rate limiter for unauthenticated user
    Calls by unauthenticated users were failing at API rate limiter as it
    failed to access user info object. This is a bug.

    API rate limiter should short-circuit for unauthenicated users so a
    proper Forbidden response can be returned by API

    Add regression test to verify that unauthenticated users get 403
    response when calling the /chat API endpoint

Minor

  • b1269fd Remove trailing slash to normalize khoj url in obsidian plugin settings
  • bb1c1b3, 8917228 Move used /api/config API controllers into separate module
  • 5f97357 Delete unused /api/beta API endpoint
  • ffdb291 Fix error message rendering in khoj.el, khoj obsidian chat
  • 7dfbcd2 Handle deprecation warnings for subscribe renew date, langchain, pydantic & logger.warn

- Fix failed to index error message in khoj.el
- Fix chat model not configured message in khoj obsidian chat
Calls by unauthenticated users were failing at API rate limiter as it
failed to access user info object. This is a bug.

API rate limiter should short-circuit for unauthenicated users so a
proper Forbidden response can be returned by API

Add regression test to verify that unauthenticated users get 403
response when calling the /chat API endpoint
- Ensure langchain less than 0.2.0 is used, to prevent breaking
  ChatOpenAI, PyMuPDF usage due to their deprecation after 0.2.0
- Set subscription renewal date to a timezone aware datetime
- Use logger.warning instead of logger.warn as latter is deprecated
- Use `model_dump' not deprecated dict to get all configured content_types
@debanjum debanjum force-pushed the short-circuit-api-rate-limiter branch from 5ca506b to 7dfbcd2 Compare January 11, 2024 20:26
@debanjum debanjum added the fix Fix something that isn't working as expected label Jan 11, 2024
- Use /api/health for server up check instead of api/config/default
- Remove unused `khoj--post-new-config' method
- Remove the now unused /config/data GET, POST API endpoints
@debanjum debanjum force-pushed the short-circuit-api-rate-limiter branch from a64771e to d7df601 Compare January 16, 2024 13:48
@debanjum debanjum force-pushed the short-circuit-api-rate-limiter branch from d7df601 to d26a4ff Compare January 16, 2024 19:10
@debanjum debanjum merged commit 4d30f7d into master Jan 16, 2024
15 checks passed
@debanjum debanjum deleted the short-circuit-api-rate-limiter branch January 16, 2024 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix something that isn't working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants