Skip to content
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

Publisher is not trusted #99

Closed
dark-matter-matters opened this issue Jun 12, 2019 · 1 comment
Closed

Publisher is not trusted #99

dark-matter-matters opened this issue Jun 12, 2019 · 1 comment

Comments

@dark-matter-matters
Copy link

dark-matter-matters commented Jun 12, 2019

Hello,
My issue seems very similar to this one : #92.

I have the very same listener class as in this tutorial : http://voryx.net/getting-started-with-the-thruwaybundle-for-symfony/

services.yaml

my.listener:
         class: App\EventListener\MyListener
         arguments:
             - "@thruway.client"
         tags:
             - { name: doctrine.event_listener, event: postPersist }
             - { name: doctrine.event_listener, event: postUpdate }

thruway.yaml

voryx_thruway:
  realm: 'realm1'
  url: 'ws://127.0.0.1:8080' #The url that the clients will use to connect to the router
  enable_logging: true
  router:
    ip: '127.0.0.1'  # the ip that the router should start on
    trusted_port: '8081' # Bypasses all authentication.  Use this for trusted clients.
    port: '8080'  # public facing port.  If authentication is enabled, this port will be protected
    authentication: true # true will load the AuthenticationManager
    authorization: thruway_auth_manager

When using my auth provider, the clientManager is not allowed to publish anymore. When there's no authentication, it works well.

I tried making this class a Client that I add as an internal client in the router command :

ThruwayRouterCommand.php

[...]
$participantListenener = $this->getContainer()->get('my.listener');
$server->addInternalClient($participantListenener);

How can I tell Thruway this class is trusted and does not need to be authenticated? Must be a tiny config line I'm missing.
Been trying different things for days, debugging even Thruway files, I could find that if ($session->getTransport()->isTrusted()) of processMessage() is false on AuthenticationManager.php file.

Thanks.

@dark-matter-matters
Copy link
Author

dark-matter-matters commented Jun 12, 2019

Ok so that's what I said, there's only a tiny config line missing. Not mentionned in the docs. Had to guess it with debug :

thruway.yaml

voryx_thruway:
  realm: 'realm1'
  url: 'ws://127.0.0.1:8080' #The url that the clients will use to connect to the router
  trusted_url: 'ws://127.0.0.1:8081' # The url that the trusted clients will use !!!
  enable_logging: true
  router:
    ip: '127.0.0.1'  # the ip that the router should start on
    port: '8080'  # public facing port.  If authentication is enabled, this port will be protected
    trusted_port: '8081' # Bypasses all authentication.  Use this for trusted clients.
    authentication: true # true will load the AuthenticationManager
    authorization: thruway_auth_manager

By default trusted url is 8080 even though trusted port is set to 8081...

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

No branches or pull requests

1 participant