Skip to content

Conversation

@VladIftime
Copy link
Collaborator

No description provided.

VladIftime and others added 25 commits May 23, 2025 14:08
* 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]>
…on status on the server side

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.
@MauriceHendrix MauriceHendrix self-requested a review June 17, 2025 10:50
Copy link
Contributor

@MauriceHendrix MauriceHendrix left a 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/
Copy link
Contributor

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
Copy link
Contributor

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():
Copy link
Contributor

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(
Copy link
Contributor

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?


# Start S2 session with the connection details
logger.info("Starting S2 session...")
start_s2_session(
Copy link
Contributor

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()
Copy link
Contributor

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?

@Flix6x Flix6x mentioned this pull request Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants