-
Notifications
You must be signed in to change notification settings - Fork 4
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
using oauth and openapi #86
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f9596b4
using oauth and openapi
cehbrecht 9b48d4a
clean imports
cehbrecht 1836765
typo
cehbrecht bb02b87
skipped "default" token type
cehbrecht f9dc02b
pep8
cehbrecht cb4705f
update api doc
cehbrecht 4cb199b
to_json -> json
cehbrecht 416c242
added interface.py
cehbrecht 1b3753b
renamed request.is_verified
cehbrecht 6ef7b51
using ows_security flag
cehbrecht f4b9b52
updated docs
cehbrecht File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../environment.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pip install -e . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Atom/1.38.2 Chrome/61.0.3163.100 Electron/2.0.18 Safari/537.36" version="9.1.0" editor="www.draw.io" type="device"><diagram id="6b31b2c4-f107-957b-7422-773966168f4d" name="Page-1">7Zpdc9o4FIZ/DTO7N4xsYdlcAiXZzjYTpnSa7qWwha2NsRghAuyvX8mW8Yec1AkY0kmTi+AjWZbOc3T8HpEenKz2txyvozsWkLhng2Dfg596tm1ZtiP/KMshs3geygwhp4HuVBjm9D+ijUBbtzQgm0pHwVgs6Lpq9FmSEF9UbJhztqt2W7K4+tQ1DolhmPs4Nq0PNBCRXoXtFva/CA2j/MkWGmYtC+w/hpxtE/28ng2X6U/WvML5WHqhmwgHbFcywWkPTjhjIvu02k9IrHybuy277+aZ1uO8OUlEqxv0ip5wvCX5lNOJiUPujHQ5RN1g9eB4F1FB5mvsq9adxC9tkVjFuvm4IKAuBGePZMJixtOhYOAOF6BoyX0rlz1e0jgu9VwuCfJ9ZWeJ0AFiefIaxzRM5IUvV0hk57G5ZO2FJ8IF2ZdM2gW3hK2I4AfZRbfaQMerDldrqPHsCvjOQPeJyuBd3RHrgAuPYxdOlx+035sZOAaC+4e5NMw42x9eoAFOpeHZC4hQGxqBQ7xgcCka+ebQNOwGGrYHTBroDDCgZXicBDI36EvGRcRCluB4WljHVSYl/wd4Ex13jrqYYSH9lKQWGyjrv0SIg3Yp3gomTcVDvjC2zlHW6Y0+qV+DHjTpgfSngd6zsDZsy329fJ0hBOYh0b2gdrTyzItEOYmxoE/VrHoKHjNdzYm/5VSop33BBxmDNorlNMcL9SlUn/744QCZnsFERiBdUh8L0rPlk8D9aCsiNdw36b/kT/POLjffwpMZpV0q9HxyuVRY33ywIRVaHW0+75lM+JWEdJNNswHv/Zoko9nnjOlXshEXJol8jyyWrdIoJt7yUiQd0CKNwo5IWpaB8mE2/9WkRdpBz7ZBWr1+c7lVJANgIrHsrpDYJpK7bpGgBXJa6QspkO3rIBkMrokEmkhuOkUyRC7ErZAQS4o+9xpIELgikvwd9LH13/mEnb51xqh8xBExBMN+reTyavAyvanvK1ewPx9qUBsqU7PGUGkoHNfULjoG54wO6XV++KHsfaVsteEf1doHAOWGGeFUzlHttXSEdx5UJAlG6ghGXicsIZnlhiqfptO/WtDVBdExr/wkToyBBsNhZSCIrFax+5aAc34H3C8bcAiBWmp6c8ghp57lugw6ZMiSbzsq/EhV1yAryUpld/M5lXzZi5oyqbDXqMqQtckQGEo6yLI9HumGFQ2CNNCbpFA1+CtqqB445xYusKYl7Qbh0nhwZZ/j4AoY0KZ7tUtxbJbD6uBDrlOdhVCWNNTUs9H3zxPF+Q6Ha5qdl9Q7Tee3N1nRbbb9TQ5+zPBj1t7v919Xk5+sc7s4XQk5Dqi8KItkLEsc1EWlWI2kpgNpCzVEkqF93hRKZqWYbfpJrNbfJbcLVfEGiAZcz7NxqnDcC5Yn0Pyy4IEsVBKWr1u10z82Gse7Ihr3nFLtnWuuRgHVitSpmgqerXJsGKq7yhGaZ9s8PdVWmqrh5aq+a1Ffej+ShtfzOxVbZ9jAqJZbLcfcwW5XCmpoICJ7KXPV10V1AlIORx+RD6wLkwY+XSncfHP+roVPrYWvkLchrNfCMD9FeW0tDG2zFm73CpCuwYdSt7XqsHlh0uaT9KSLkM3GbPlakJfF//Zk3Yt/oILT/wE=</diagram></mxfile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,65 @@ | ||
.. toctree:: | ||
:hidden: | ||
|
||
.. _api: | ||
|
||
************************* | ||
XML-RPC API Documentation | ||
************************* | ||
############# | ||
API Reference | ||
############# | ||
|
||
.. contents:: | ||
:local: | ||
:depth: 2 | ||
:depth: 1 | ||
|
||
.. automodule:: twitcher | ||
|
||
Twitcher Client | ||
=============== | ||
|
||
.. autoclass:: twitcher.client.TwitcherService | ||
:members: | ||
:undoc-members: | ||
|
||
Twitcher CLI | ||
============ | ||
|
||
.. automodule:: twitcher.scripts.twitcherctl | ||
:members: | ||
|
||
.. _openapi_api: | ||
|
||
OpenAPI interface | ||
================= | ||
|
||
.. autoclass:: twitcher.api.TwitcherAPI | ||
:members: | ||
|
||
.. _oauth2_api: | ||
|
||
OAuth2 Tokens | ||
============= | ||
|
||
.. automodule:: twitcher.oauth2 | ||
:members: | ||
|
||
To use the XML-RPC interface, connect to twitcher’s HTTP port with any XML-RPC client library and run commands against it. | ||
An example of doing this using Python’s ``xmlrpclib`` client library is as follows. | ||
.. autoclass:: twitcher.oauth2.RandomTokenValidator | ||
:members: | ||
|
||
.. code-block:: python | ||
.. autoclass:: twitcher.oauth2.SignedTokenValidator | ||
:members: | ||
|
||
import xmlrpc.client as xmlrpclib | ||
server = xmlrpclib.Server('http://localhost:8000/RPC2') | ||
.. autoclass:: twitcher.oauth2.CustomTokenValidator | ||
:members: | ||
|
||
.. warning:: | ||
.. _ows_registry_api: | ||
|
||
When accessing the default HTTPS service you need to deactivate SSL verfication. | ||
See ``twitcher/client.py`` how this can be done. You may also use the following code:: | ||
OWS Registry | ||
============ | ||
|
||
>> from twitcher import client | ||
>> server = client._create_server('https://localhost:8000/RPC2', verify_ssl=False) | ||
.. autoclass:: twitcher.owsregistry.OWSRegistry | ||
:members: | ||
|
||
The `XML-RPC <http://xmlrpc.scripting.com/>`_ interface can also be accessed from Java and other languages. | ||
.. _ows_proxy_api: | ||
|
||
See the ``twitcher/rpcinterface.py`` module for the available xmlrpc methods: | ||
OWS Proxy | ||
========= | ||
|
||
.. autoclass:: twitcher.rpcinterface.RPCInterface | ||
:members: | ||
.. automodule:: twitcher.owsproxy | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
installation | ||
configuration | ||
dev_guide | ||
running | ||
tutorial | ||
api | ||
changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,34 +55,11 @@ For development you can use this command: | |
Initialize Database | ||
=================== | ||
|
||
Initialize and upgrade the database using Alembic_. | ||
|
||
Generate your first revision: | ||
|
||
.. code-block:: console | ||
|
||
$ conda activate twitcher | ||
$ alembic -c development.ini revision --autogenerate -m "init" | ||
|
||
.. warning:: | ||
|
||
This first step is only needed in development to generate a new database schema version. | ||
|
||
Upgrade to that revision: | ||
Before you can start the service you need to initialize or upgrade the database: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see previous note |
||
|
||
.. code-block:: console | ||
|
||
$ alembic -c development.ini upgrade head | ||
|
||
Load default data into the database using a script. | ||
|
||
.. code-block:: console | ||
|
||
$ initialize_twitcher_db development.ini | ||
|
||
.. note:: | ||
|
||
You can use `make migrate` as a shortcut to upgrade or init the twitcher database (last two steps). | ||
$ make migrate | ||
|
||
Starting Twitcher Service | ||
========================= | ||
|
@@ -94,6 +71,8 @@ Start the twitcher service using the `development.ini` configuration: | |
.. code-block:: console | ||
|
||
$ pserve development.ini --reload | ||
OR | ||
$ make start | ||
|
||
.. _waitress: https://docs.pylonsproject.org/projects/waitress/en/latest/ | ||
.. _Conda: https://conda.io/en/latest/ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe database migration should be done automatically, otherwise chances are Twitcher's schemas in the code vs the retrieved ones from the db will mismatch and just cause the app to crash.
Expected behaviour should be that the db and its schemas are migrated up/down on boot time to match the installed Twitcher version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know ... I thought it would be safer to run
make migrate
intentionally. Though it might not harm when run each time beforemake start
.