# kolibri-desktop-auth-plugin
Authentication backend that allows an HTTP client to authenticate by providing
a desktop user token
# Testing
This is a kolibri plugin, you need to install the python package in the kolibri
python environment using pip and then enable the plugin.
```
.../kolibri $ pip install -e ../kolibri-desktop-auth-plugin
.../kolibri $ kolibri plugin enable kolibri_desktop_auth_plugin
```
To test you can launch the fake user info dbus daemon included in this
repository:
```
./fake-dbus-daemon.py
```
After enabling the fake dbus daemon you can try to autologin in your kolibri
with the plugin opening the following url in your browser:
http://localhost:8000/kolibri_desktop_auth_plugin/login/TOKEN1
You can change the TOKEN at the end of the url above to test with different
user data:
* TOKEN1: adminuser, user with admin rights
* TOKEN2: eosuser, user without admin rights
You can test also with a non existent token that should redirect to the login
page.
It's also possible to redirect after the authentication passing the next url as
a get parameter to the url, for example:
http://localhost:8000/kolibri_desktop_auth_plugin/login/TOKEN1?next=/learn
# Development
Setup the Python environment:
```
pipenv install
```
Setup pre-commit:
```
pipenv run pre-commit install
```
Enter the Python environment for development:
```
pipenv shell
```
# Releasing
## Creating a release
If you are releasing a new version, use `bump-version` with with `major`, `minor`, or `patch`. For example:
```
yarn bump-version patch
```
This creates a new commit and a git tag. Push this to the remote:
```
git push
git push --tags
```
Create a `.whl` file:
```
python setup.py bdist_wheel --universal
```
Finally, upload the `.whl` file to PyPi:
```
twine check -s dist/*
twine upload -s dist/*
```
Raw data
{
"_id": null,
"home_page": "https://github.com/endlessm/kolibri-desktop-auth-plugin",
"name": "kolibri-desktop-auth-plugin",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "kolibri",
"author": "EndlessOS",
"author_email": "danigm@endless.org",
"download_url": null,
"platform": null,
"description": "# kolibri-desktop-auth-plugin\n\nAuthentication backend that allows an HTTP client to authenticate by providing\na desktop user token\n\n# Testing\n\nThis is a kolibri plugin, you need to install the python package in the kolibri\npython environment using pip and then enable the plugin.\n\n```\n .../kolibri $ pip install -e ../kolibri-desktop-auth-plugin\n .../kolibri $ kolibri plugin enable kolibri_desktop_auth_plugin\n```\n\nTo test you can launch the fake user info dbus daemon included in this\nrepository:\n\n```\n./fake-dbus-daemon.py\n```\n\nAfter enabling the fake dbus daemon you can try to autologin in your kolibri\nwith the plugin opening the following url in your browser:\n\nhttp://localhost:8000/kolibri_desktop_auth_plugin/login/TOKEN1\n\nYou can change the TOKEN at the end of the url above to test with different\nuser data:\n\n * TOKEN1: adminuser, user with admin rights\n * TOKEN2: eosuser, user without admin rights\n\nYou can test also with a non existent token that should redirect to the login\npage.\n\nIt's also possible to redirect after the authentication passing the next url as\na get parameter to the url, for example:\n\nhttp://localhost:8000/kolibri_desktop_auth_plugin/login/TOKEN1?next=/learn\n\n# Development\n\nSetup the Python environment:\n\n```\npipenv install\n```\n\nSetup pre-commit:\n\n```\npipenv run pre-commit install\n```\n\nEnter the Python environment for development:\n\n```\npipenv shell\n```\n\n\n# Releasing\n\n## Creating a release\n\nIf you are releasing a new version, use `bump-version` with with `major`, `minor`, or `patch`. For example:\n\n```\nyarn bump-version patch\n```\n\nThis creates a new commit and a git tag. Push this to the remote:\n\n```\ngit push\ngit push --tags\n```\n\nCreate a `.whl` file:\n\n```\npython setup.py bdist_wheel --universal\n```\n\nFinally, upload the `.whl` file to PyPi:\n\n```\ntwine check -s dist/*\ntwine upload -s dist/*\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Kolibri plugin for desktop authentication",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/endlessm/kolibri-desktop-auth-plugin"
},
"split_keywords": [
"kolibri"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6e12642ddff994b0ce1f86fb81835f4977b7caa48a94e927f91493c7888bd666",
"md5": "a21c9c421c749746af040eba3d615045",
"sha256": "7741f1ac7c6cff392f0228192ed1b981a7812909312552b8a9e642d195a317c6"
},
"downloads": -1,
"filename": "kolibri_desktop_auth_plugin-1.0.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "a21c9c421c749746af040eba3d615045",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4671,
"upload_time": "2024-05-25T00:23:27",
"upload_time_iso_8601": "2024-05-25T00:23:27.829422Z",
"url": "https://files.pythonhosted.org/packages/6e/12/642ddff994b0ce1f86fb81835f4977b7caa48a94e927f91493c7888bd666/kolibri_desktop_auth_plugin-1.0.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-25 00:23:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "endlessm",
"github_project": "kolibri-desktop-auth-plugin",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "kolibri-desktop-auth-plugin"
}