-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
feat: glee authentication #439
Conversation
Pull Request Test Coverage Report for Build 5015786436
💛 - Coveralls |
A few questions:
Sorry, lots of questions. 😆 just want everything to be clear. |
No problems @KhudaDad414 the questions are necessary.
I will take a look at the WebSockets adapters compared to others. I think an authentication property could be added there. Further inputs are welcomed @Souvikns @KhudaDad414 I will really appreciate it I do have a question about authentication on connection since WebSockets are stateless, doesn't that mean each request is independent and we would need a type of cache to track authenticated clients? |
Kudos, SonarCloud Quality Gate passed! |
This discussion is continued on #460 |
Description
Glee Authentication PR
In order to introduce authentication to Glee, I've been looking at the middleware, which offers the most opportunity as we advance.
One idea is to create an authentication middleware that reads the user’s authentication.
The authentication file will be similar to a lifecycle event, it will have the
server
and thechannel
export along with a default export.In the
authMiddleware.ts
file:The authentication file will take the following format
In the index.ts file
:app.useInbound()
doesn’t exist in the codebase so it’ll be createdWe’ll create a file that allows us to parse the user authentication similar to what Glee does with lifecycle events.
Another idea I’ve been trying to explore is to see if Glee middleware is extendable, if it’s possible we could allow the user to write a middleware then read such middleware and pass it to Glee during initialization.
Since
app.useOutbound()
already supports channel property as follows:Restriction of auths to a particular channel should be easy. We could make
app.useInbound()
exactly likeapp.useOutbound()
but for incoming messages.Related issue(s)
Discusses #377
@Souvikns @KhudaDad414 @fmvilas
#377