Giter Club home page Giter Club logo

Comments (8)

Florimond avatar Florimond commented on July 29, 2024

Hello,

you can use the keygen api with the secret key that is displayed in the "security" section of your account. You'll find some documentation about this here under Channel Security And Authorization.

Of course, this key should never be distributed to actual clients.

If what you need is to generate keys at runtime from client, this not possible for at least the following two reasons :

  • the channel/subchannel pattern fits most use cases
  • generating keys that allow generating other keys seems unsafe

from emitter.

jurgen-kluft avatar jurgen-kluft commented on July 29, 2024

from emitter.

Florimond avatar Florimond commented on July 29, 2024

Not from a configuration file. I would simply use the keygen api.

Are you talking about the documentation about rolling your own servers?

from emitter.

jurgen-kluft avatar jurgen-kluft commented on July 29, 2024

from emitter.

jurgen-kluft avatar jurgen-kluft commented on July 29, 2024

Requesting a channel key from the broker succeeds, also for the second process (the channel-keys are different). Then i proceeded to take the key from the first process and use that in the second process, still publishing a message is not received by the first process who is a subscriber.
The 2nd process is the one that connects to the broker and does a PublishTTL.
The only thing that seems to work is if i go to the /keygen page and register manually.

Am i doing something wrong when requesting a key from the server from my process (written in Go)?

P.S.: I had to search what to fill in for the 'Type' as "rwslp" to give it all the rights.

Best
Jurgen

from emitter.

jurgen-kluft avatar jurgen-kluft commented on July 29, 2024

Ok i was a bit too premature in my above statement, it does work now.
Process 1 requests a key with "rwslp" rights and subscribes to channel X.
Process 2 requests a key with "rwslp" rights and publishes a message to channel X.
Channel keys are different, but the message is received by process 1.

So it all works now!

from emitter.

bagitom avatar bagitom commented on July 29, 2024

hello!

please let me know @Florimond or @jurgen-kluft, how to use securely emitter.io with javascript. Since it is a client side-script, the channel key will shown in the DOM, so it can be stolen.
Sould I generate a new channel key in (let's say) every 10 minutes? A bit more secure, but it doesn't seem to be the correct solution.

But if I have to do it like above, then:

  1. how to generate the new channel key? It must not be made on client side, in order not to be shown my secret key in the DOM :)

  2. (if it is needed,) how to tidy the zombie channels after every 10 minutes?

thanks
Tamas

from emitter.

Florimond avatar Florimond commented on July 29, 2024

@bagitom
There is the notion of extendable channels now. If I remember correctly, it should work like this...

  • You create type e key for a root channel to give to (A). It should only be able to extend.
  • You create a key with full rights to this root channel to give to (B).
  • (B) subscribes to the root channel and all sub-channels.
  • (A) extends his channel with his special key by calling Keygen. It receives a response with the the root channel to which was added a random suffix, this is your extension.
  • (A) publishes sort of a hello to his extended channel, that way (B) sees a message coming from this extended channel and knows to answer through that specific channel.

Hope this helps. It should be the subject of a small tutorial in the future...

from emitter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.