-
Notifications
You must be signed in to change notification settings - Fork 6
Abstract Server class and a default implementation #122
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
base: feat/abstract_client
Are you sure you want to change the base?
Conversation
Signed-off-by: F.N. Claessen <[email protected]>
…thon into feat/abstract_server
* refactor: split up default server class into parts handling tokens and challenges and part setting up a default HTTP server Signed-off-by: F.N. Claessen <[email protected]> * dev: remove abstract methods to start and stop the server Signed-off-by: F.N. Claessen <[email protected]> * fix: actually remove abstract methods to start and stop the server Signed-off-by: F.N. Claessen <[email protected]> * refactor: util function for creating JSON response Signed-off-by: F.N. Claessen <[email protected]> * style: extra linebreak Signed-off-by: F.N. Claessen <[email protected]> * refactor: subclass S2DefaultHTTPHandler so we can reuse new class method Signed-off-by: F.N. Claessen <[email protected]> * dev: temporarily decrease the pylint acceptance criterion Signed-off-by: F.N. Claessen <[email protected]> * style: add type annotations Signed-off-by: F.N. Claessen <[email protected]> * style: add return type annotation Signed-off-by: F.N. Claessen <[email protected]> * style: compatibility with Python 3.8 Signed-off-by: F.N. Claessen <[email protected]> --------- Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
…tivate the controll type
Signed-off-by: F.N. Claessen <[email protected]>
…er/s2-python into feat/abstract_server
…atus Signed-off-by: F.N. Claessen <[email protected]>
…er/s2-python into feat/abstract_server
…on status on the server side Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
…bsocket connection of the client in order to make sure messages are sent to the right RM.
…er/s2-python into feat/abstract_server
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.
what ar the src/.DS_Store files?
the websocket server (and default server) lack a mechanism to verify authorisation header.
also make sure to use the encryption suite/algorithm selected by the client (instead of hard coded)
| dist/ | ||
| build/ | ||
| %LOCALAPPDATA% | ||
| temp_java/ |
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.
what's that about? (Seems a bit odd in a python library is all)
tox.ini
Outdated
| -r dev-requirements.txt | ||
| commands = | ||
| pylint src/ tests/unit/ | ||
| pylint src/ tests/unit/ --fail-under=9.8 |
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.
what's the reson behind this?
| import json | ||
|
|
||
|
|
||
| async def hello(): |
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 come up with a better name than hello for the test?
| uri = "ws://localhost:8080" # <-- Replace with your server's URI | ||
| try: | ||
| async with websockets.connect(uri) as websocket: | ||
| message = Handshake( |
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.
In the final implementation I'd expect the websocket server to require a valid authorisation header?
examples/example_pairing_frbc_rm.py
Outdated
|
|
||
| # Start S2 session with the connection details | ||
| logger.info("Starting S2 session...") | ||
| start_s2_session( |
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.
You'd need to add the decrypted chellange as bearer token
| Tuple[str, str]: (public_key, private_key) pair as base64 encoded strings | ||
| """ | ||
| logger.info("Generating key pair") | ||
| self._key_pair = Jwk.generate_for_alg("RSA-OAEP-256").with_kid_thumbprint() |
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 guess you wnat to pick the algorithm based on what the client posted?
…he ws connection Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
No description provided.