⚠️ Experimental, use at your own risk.This repository is shared to be helpful and for informational purposes (not officially supported, not for production use).
For assistance, refrain from contacting Coveo support and use Github issues instead.
An attempt to use the Coveo search engine as an account database for a website. Simple features include:
- Account creation
- Account login
- Password changes
This should never be used in a real product, this is purely for showing the flexibility of the Coveo search.
This project is meant as a test case to demonstrate the capabilities and flexibility of the Coveo Search. It is meant to replace the traditional database system in a full-stack for a website. So intead of using something like, MySQL or SQLITE to store your usernames and password, this uses Coveo. Of course, that has it's downsides. Account creation and password modification can take up for 60 seconds sometimes. Plus sometimes the dev platform goes down, so that means your login also goes down.
- Download/clone this repo
- Install the dependencies
- See the example for sample code on how to use
- Create a new Push source
- Shared
- Create an API key and put it in the
config.yml
file underpush_api_key
- Add the name of the source under
push_name
in theconfig.yml
- Add the ID of the source under
source_id
in theconfig.yml
- Add these mappings:
Map password with %[password]
Map username with %[username]
Map salt with %[salt]
- Create an API key
- Add the permission
Search > Execute queries > Enable
- Put it in the
config.yml
file undercoveo_api_key
- Add the permission
- Add your organization name under
org_id
in theconfig.yml
- As for the
secret
inconfig.yml
, just act like a protection paladin and smash your keyboard with random letters
pip install pyyaml
pip install requests
Import the manager
from manager import Manager
Then create an instance of the class
manager = Manager()
Once you created your instance, you can do the following things:
# Add a user
manager.add_user(username, password)
# Get a user
manager.get_user(username)
# Validate a user
manager.validate_user(username, password)
# Modify a password
manager.modify_password(username, password, new_password)
# Wait until a user is created
manager.wait_until_user_created(username, timeout=90)
# All function will return a standard message format
# which looks like this
{
'type' : manager.success or manager.error
'message' : 'Some message' or {'some' : 'json'}
}
This was tested on Python 2.7.13 using platformdev
Although it SHOULD work on other python version and cloud platforms, I have not tested.