-
Notifications
You must be signed in to change notification settings - Fork 5
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
Multi Subscription Single Connection #119
Conversation
f8de0c2
to
a9e8dc3
Compare
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.
Nice progress already! Left some preliminary comments. Curious to see the rest.
server/src/Icepeak/Server/WebsocketServer/HandleClientSingleSubscription.hs
Outdated
Show resolved
Hide resolved
server/src/Icepeak/Server/WebsocketServer/HandleClientSingleSubscription.hs
Outdated
Show resolved
Hide resolved
server/src/Icepeak/Server/WebsocketServer/HandleClientSingleSubscription.hs
Outdated
Show resolved
Hide resolved
server/src/Icepeak/Server/WebsocketServer/HandleClientMultiSubscription.hs
Outdated
Show resolved
Hide resolved
server/src/Icepeak/Server/WebsocketServer/HandleClientMultiSubscription.hs
Outdated
Show resolved
Hide resolved
server/src/Icepeak/Server/WebsocketServer/HandleClientMultiSubscription.hs
Outdated
Show resolved
Hide resolved
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.
Good start already! I have a few remarks, but overall it looks like it should work
server/src/Icepeak/Server/WebsocketServer/HandleClientMultiSubscription.hs
Outdated
Show resolved
Hide resolved
server/src/Icepeak/Server/WebsocketServer/HandleClientMultiSubscription.hs
Outdated
Show resolved
Hide resolved
server/src/Icepeak/Server/WebsocketServer/HandleClientMultiSubscription.hs
Outdated
Show resolved
Hide resolved
Will begin implementing protocol specific details, then circle around and re-visit some of the comments as things begin to take more shape. |
Currently authorisation is built for:
Most relevant functions are:
Can pretty much re-use isAuthorizedByClaim :: IcepeakClaim -> Path -> AccessMode -> Bool Within case maybeSecret of
Nothing ->
-- authorization is enabled, but no secret provided, accept all tokens
getTokenBytes >>= extractClaimUnverified
Just secret -> getTokenBytes >>= extractClaim now secret Will perhaps be re-using: extractClaim :: POSIXTime -> JWT.VerifySigner -> SBS.ByteString -> Either TokenError IcepeakClaim The Can get now <- Clock.getPOSIXTime Can get the JWT.VerifySigner from the config: -- | The secret used for verifying the JWT signatures. If no secret is
-- specified even though JWT authorization is enabled, tokens will still be
-- used, but not be verified.
, configJwtSecret :: Maybe JWT.VerifySigner New protocol will need to verify a list of paths using the token provided by the Presumably the Perhaps we will have to make re-use of -- | Extract the icepeak claim from the token without verifying it.
extractClaimUnverified :: SBS.ByteString -> Either TokenError IcepeakClaim |
So it feels like the core functionality should be there. Steps to see through to the refinement process:
|
@crtschin How does it sound? Also, any suggestions for the direction on code structure? Particularly the chunky |
Discussed offline, splitting up the |
5a7ceb9
to
7b3640d
Compare
This PR should be ready for review! Overall since last time, made big refactors, added tests, adjusted endpoint entrypoint to accept re-usable connections. |
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.
Nice, I have some notes and suggestions. Might be good to setup your editor to work with fourmolu. The codestyle is quite inconsistent, and there quite some trailing whitespace strewn about.
Made a first pass over the PR comments, and pushed commits for them, the outstanding things yet to be addressed are:
Implementation:
Tests:
|
I've added a subscription deadline timeout mechanism, and added more descriptive tests. I think we can begin gradually rolling this out. We can write a list of items that we may want to be wary of and come back to and implement if we see that they are needed as we roll out. |
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.
Good work! I have a few smaller remarks, but overall looking good 👍
48e29b3
to
3e24a7b
Compare
Current State of Draft
Added 2 additional modules to separate new behaviour from old:
Current draft implements the ability for the client thread to :
Left to do: