-
Notifications
You must be signed in to change notification settings - Fork 21
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
Prototype REST implementation #183
Conversation
c3bedf9
to
301ffcf
Compare
Codecov Report
@@ Coverage Diff @@
## master #183 +/- ##
==========================================
- Coverage 99.56% 99.50% -0.06%
==========================================
Files 41 53 +12
Lines 1823 2022 +199
==========================================
+ Hits 1815 2012 +197
- Misses 8 10 +2
Continue to review full report at Codecov.
|
3f76538
to
b0192aa
Compare
I've just pushed out |
Thanks a lot. |
…3.6 and click, clear lru_cahe in unittests
I have now also changed the security scopes to better match the granted permissions. We now have
The idea is that this can be extended by further scopes like |
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.
I have one comment, but nothing critical
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.
👍
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.
Thanks for all your work. It looks really good 👍
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.
Great stuff 👍
I mainly left some comments on how docstrings might be improved. So fixing should be a no-brainer 😸
docs/source/services/services.rst
Outdated
both access and error logs into a separate file. Therefore, an ``uvicorn`` logger needs to be configured. An example | ||
can be found below. |
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.
Can we actually ensure that the example is rendered below? Maybe it is better to state something like "See the example logging configuration.".
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.
Thanks, I thing this is a better.
tardis/rest/service.py
Outdated
return self._secret_key | ||
|
||
@lru_cache(maxsize=16) | ||
def get_user(self, user_name: str) -> [None, UserCredentials]: |
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.
Do you mind checking the return type? I would expect Optional[UserCredentials]
from just reading the code below.
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.
Thanks, I have changed it to Optional[UserCredentials]
.
Co-authored-by: Eileen Kuehn <eileen.kuehn@kit.edu>
Thank you very much @eileen-kuehn for improving documentation and code. |
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.
Looks good to me 👍
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.
Great stuff, looks good to go 🥇
This pull request implements a prototype REST implementation to query the
SqlRegistry
. Currently two read-only API calls (GET
/resources/state
,GET
/resources
) are supported. The REST API implementation uses FastApi and uvicorn as ASGI server. The REST API relies on JSON Web Token and OAuth2 scopes to support authentication and authorization.Could be useful to avoid #172.
To activate the
TARDIS
REST service, simply add the following lines to yourTARDIS
configuration.to enable logging I suggest to use the following logging configuration in your
COBalD
configuration.Benchmarks:
Running one million requests against this service took about 11 minutes. Which is equivalent to a performance of about 1500 requests/s.