Hi!Recently, I'm in charge of developing a side-project which should be a semi-public event real-time API which connects to my main project. Whenever an action happens on that project, we need to send an event to all connected websockets instances, more or less like Discord bots do with their websockets gateway.But that shouldn't be a public API at all - and we would like to keep diferent scopes for different users. Let's say that an official application uses this API with all scopes, an unofficial application but authorized from us shouldn't use all scopes but only the one we provide them, so basically we need OAuth2.Now, the problem is I never implemented an OAuth2 REST server; neither a websocket one. I only used it as a client. So I'd like a framework or a library which gets my work done easier, helping me learning to implement OAuth2.Also, I need a framework to which you can connect, well, module-agnostic, without using a custom built client. For example, I used socket.io some time ago for some private projects, and as I remember, you can't connect to socket.io directly without a socket.io client; you can't connect using browser's Websocket object. I need this because I don't know who my client may be and I can't force him to use specific clients.Also it'd be cool to develop in TypeScript, but that's a secondary thing for learning purposes.I tried the ws npm module, but seems harder than it should be to get things done just because I should implement OAuth2 from scratch.I tried Actionhero and it seems overkill for the project, to learn an entire new paradigm for something little as a small semi-public API with whitelisted access.I also tried Feather, but it seems to need a Feather client, or a socket.io client, and so it isn't module-agnostic.Thanks in advance for any help.
Submitted July 31, 2020 at 04:46PM by DanielVip3
No comments:
Post a Comment