I've created an apollo-server with graphql-subscriptions, and that's all good so far. I can receive publications on the front-end. Great!
What I want to do now is only send publications to authorized users, so, some sort of logic/test needs to be done. But where and how? All the examples and things I've seen involve blindly receiving messages from a redis server, and setting it back to the client. I can test which user is logged in, but what now? Individual microservices will talk to an auth/user service and decide allowed actions based on that. No problem. But how do I stop redis broadcasts from getting to the wrong users? All apollo-server does is listen to messages from redis - not validate them.
The only thing I can really think of is have some sort of permissions object field on every broadcast, and using graphql to validate it against the auth service. Does not seem right. I want my auth done in the microservices. Anything pointing me in the right direction would be amazing.