Matthias247 / jawampa

Web Application Messaging Protocol (WAMP v2) support for Java
Apache License 2.0
148 stars 57 forks source link

Dynamic creation of Realms #91

Open sebastianwahn opened 8 years ago

sebastianwahn commented 8 years ago

Currently, there is no possibility to add Realms after the router was built. Accodring to the specification it is the routers business if he creates realms after it is started.

Note. The behavior if a requested "Realm" does not presently exist is router-specific. A router may e.g. automatically create the realm, or deny the establishment of the session with a "ABORT" reply message.

See: https://tools.ietf.org/html/draft-oberstet-hybi-tavendo-wamp-02#section-7.1.2

In this case i would suggest that: a) a client requests a realm which is not created, then the router can create it (set via option when the router is built) b) the router can dynamically create realms within the code router.addRealm(...) (currently only possible before the object is built)

Use case - microservice architecture: A client authenticates via BasicAuth/oAuth/... on a REST-Interface. The router gets notified, that a authenticated client wants to access the services of the application. Afterwards, a realm is created where the user can interact with other users and/or services which are also connecting to the new realm. In this case the user can interact with other users who can join the realm (via invitation, ...) and the services who joined the realm.