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

Add support for a first-party client app to call into Khoj (Part 1) #601

Merged
merged 9 commits into from
Jan 18, 2024

Conversation

sabaimran
Copy link
Member

@sabaimran sabaimran commented Jan 6, 2024

Incoming

  • Add a new ClientApplication model, consisting of a client ID and client secret which allows an external first party application to call into the Khoj server and access a particular user's data (and get access to all khoj chat features!)
    • Initial implementation uses phone numbers as the identifier for users
  • Part 2 will allow users to specify their phone numbers to associate their Khoj account with a number. Otherwise, orphaned phone numbers can exist which are connected to first party applications.

- Based on a client id and client secret, allow a first party app to call into the Khoj backend with a phone number identifier
- Add migration to add phone numbers to the KhojUser object
- Decrease free tier limit to 5 (from 10)
- Return a response object when handling stripe webhooks
@sabaimran sabaimran added the upgrade New feature or request label Jan 6, 2024
@sabaimran sabaimran requested a review from debanjum January 6, 2024 12:41
Copy link
Member

@debanjum debanjum left a comment

Choose a reason for hiding this comment

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

Left some comments but otherwise looks great! Looking forward to the functionality dedup from making Khoj whatsapp a first-party client of the main Khoj codebase

src/khoj/configure.py Outdated Show resolved Hide resolved
src/khoj/configure.py Outdated Show resolved Hide resolved
src/khoj/database/adapters/__init__.py Show resolved Hide resolved
src/khoj/database/adapters/__init__.py Show resolved Hide resolved
src/khoj/database/adapters/__init__.py Show resolved Hide resolved
@sabaimran
Copy link
Member Author

Updated based on feedback in khoj-ai/flint#14 to make the client secret come through the authorization header.

@sabaimran sabaimran merged commit 039ed78 into master Jan 18, 2024
9 checks passed
@sabaimran sabaimran deleted the features/support-first-party-client-app branch January 18, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upgrade New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants